splunk-emit

1.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i splunk-emit

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

278 MB

Total Files

16

Last publish

Collaborators

  • klatu201