Socket
Socket
Sign inDemoInstall

bunyan-cassandra

Package Overview
Dependencies
5
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.3 to 0.0.4

7

lib/bunyan-cassandra.js

@@ -17,2 +17,4 @@ 'use strict';

function BunyanCassandra(opts) {
opts = opts || {};
this.hosts = opts.hosts || ['localhost'];

@@ -25,2 +27,3 @@ this.keyspace = opts.keyspace || 'logs';

this.callback = opts.callback;
this.transform = opts.transform;

@@ -41,2 +44,6 @@ this.client = new cql.Client({

BunyanCassandra.prototype.write = function (row) {
if (isFunction(this.transform)) {
row = this.transform(row);
}
var ctx = this;

@@ -43,0 +50,0 @@ var argsValues = this.args.map(function (arg) {

2

package.json
{
"name": "bunyan-cassandra",
"version": "0.0.3",
"version": "0.0.4",
"description": "Cassandra bunyan stream",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -63,2 +63,5 @@ bunyan-cassandra

// or catch possible Cassandra errors
},
transform: function (log) {
// add/remove/edit log object
}

@@ -149,1 +152,11 @@ })

**default** ``undefined``
#### transform
Each time when new log is received, log will be passed as argument to ``transform`` function, so you will have opportunity to modify raw log data, for example add or remove some fields from log.
```
transform: function (row) {
// let we say we want date with specific format
row.date = moment(row.time).format('YYYY-MM-DD');
return row;
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc