end

splunkjs.ModularInputs.ModularInput.end

Runs once the streaming ends, for an input (upon successfully streaming all events).

Syntax

ModularInput.prototype.end = function(name, definition, done)

Parameters

Name Type Description
name String

The name of this modular input.

definition Object

An InputDefinition object.

done Function

The function to call when done: (err).

runScript

splunkjs.ModularInputs.ModularInput.runScript

Handles all the specifics of running a modular input.

Syntax

ModularInput.runScript = function(exports, args, eventWriter, inputStream, callback)

Parameters

Name Type Description
exports Object

An object representing a modular input script.

args Array

A list of command line arguments passed to this script.

eventWriter Object

An EventWriter object for writing event.

inputStream Object

A Stream object for reading inputs.

callback Function

The function to call after running this script: (err, status).

service

splunkjs.ModularInputs.ModularInput.service

Returns a splunkjs.Service object for this script invocation.

The service object is created from the Splunkd URI and session key passed to the command invocation on the modular input stream. It is available as soon as the ModularInput.streamEvents function is called.

Syntax

ModularInput.service = function()

Return

Object.

A Splunkjs.Service Object, or null if you call this function before the ModularInput.streamEvents function is called.

setup

splunkjs.ModularInputs.ModularInput.setup

Runs before streaming begins.

Syntax

ModularInput.prototype.setup = function(done)

Parameters

Name Type Description
done Function

The function to call when done: (err).

start

splunkjs.ModularInputs.ModularInput.start

Runs once the streaming starts, for an input.

Syntax

ModularInput.prototype.start = function(name, definition, done)

Parameters

Name Type Description
name String

The name of this modular input.

definition Object

An InputDefinition object.

done Function

The function to call when done: (err).

teardown

splunkjs.ModularInputs.ModularInput.teardown

Runs after all streaming is done for all inputs definitions.

Syntax

ModularInput.prototype.teardown = function(done)

Parameters

Name Type Description
done Function

The function to call when done: (err).