init

splunkjs.StormService.init

Constructor for splunkjs.StormService.

Syntax

init: function(http, params)

Parameters

Name Type Description
http splunkjs.Http

An instance of a splunkjs.Http class.

params Object

A dictionary of parameters:
* token: The API token for Storm.

Return

splunkjs.StormService.

A new splunkjs.StormService instance.

log

splunkjs.StormService.log
Endpoint: inputs/http

Logs an event to Splunk Storm.

Syntax

log: function(event, params, callback)

Parameters

Name Type Description
event String,Object

The text for this event or an object that will be converted to JSON.

params Object

A dictionary of parameters for indexing:
* project: The project to send events from this input to (use your project token).
* host: The value to populate in the host field for events from this data input.
* source: The source value to fill in the metadata for this input's events.
* sourcetype: The sourcetype to apply to events from this input.
* TZ: The timezone to apply to events.

callback Function

A function to call when the event is submitted: (err, result).

Examples

storm.log(
    "MY AWESOME LOG MESSAGE", 
    {project: "XYZ123", sourcetype: "GO"},
    function(err, response) {
        console.log("DATA IS IN STORM!");         
    }
);