splunk-emit
JavaScript library to emit JSON "events" to splunk via a HEC
Last updated 9 months ago by klatu201 .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install splunk-emit 
SYNC missed versions from official npm registry.

Splunk Emit

JavaScript library to emit JSON "events" to splunk via a HEC
Includes native (win|mac|linux) cli


Support

  • Node

Setup

npm install splunk-emit

ES5 Example




const splunk_emit = require("splunk-emit");

const emitter = new splunk_emit.HEC_Emitter({
    debug : true,
    splunk_url : "{{target-SPLUNK_URL}}", //OR set environment var SPLUNK_URL
    splunk_hec : "{{target-SPLUNK_HEC}}" //OR set environment var SPLUNK_HEC
});

 let eventBatch = new splunk_emit.EventBatch({
        debug : true
    });
eventBatch.enableAutoFlush(emitter, 1); //1 sec flush

eventBatch.add( {
    name : "value",
    index : 1,
    text : "this ia an example"
} );

emitter.on( 'flush', () => {
    process.exit();
});

API


Cli

Current Tags

  • 1.0.1                                ...           latest (9 months ago)

2 Versions

  • 1.0.1                                ...           9 months ago
  • 1.0.0                                ...           9 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (9)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |