com.splunk.examples.random_numbers
Class Program

java.lang.Object
  extended by com.splunk.modularinput.Script
      extended by com.splunk.examples.random_numbers.Program

public class Program
extends Script


Constructor Summary
Program()
           
 
Method Summary
 Scheme getScheme()
          Gets the scheme that defines the parameters understood by this modular input.
static void main(java.lang.String[] args)
           
 void streamEvents(InputDefinition inputs, EventWriter ew)
          Streams events into Splunk.
 void validateInput(ValidationDefinition definition)
          Handles external validation for modular input kinds.
 
Methods inherited from class com.splunk.modularinput.Script
run, run
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Program

public Program()
Method Detail

main

public static void main(java.lang.String[] args)

getScheme

public Scheme getScheme()
Description copied from class: Script
Gets the scheme that defines the parameters understood by this modular input.

Specified by:
getScheme in class Script
Returns:
A Scheme object representing the parameters for this modular input.

validateInput

public void validateInput(ValidationDefinition definition)
                   throws java.lang.Exception
Description copied from class: Script
Handles external validation for modular input kinds. When Splunk called a modular input script in validation mode, it will pass in an XML document giving information about the Splunk instance (so you can call back into it if needed) and the name and parameters of the proposed input. If this function does not throw an exception, the validation is assumed to succeed. Otherwise any error thrown will be turned into a string and logged back to Splunk. The default implementation always passes.

Overrides:
validateInput in class Script
Parameters:
definition - The parameters for the proposed input passed by splunkd.
Throws:
java.lang.Exception

streamEvents

public void streamEvents(InputDefinition inputs,
                         EventWriter ew)
                  throws MalformedDataException,
                         javax.xml.stream.XMLStreamException,
                         java.io.IOException
Description copied from class: Script
Streams events into Splunk. It should do all of its output via EventWriter rather than assuming that there is a console attached.

Specified by:
streamEvents in class Script
ew - An object with methods to write events and log messages to Splunk.
Throws:
MalformedDataException
javax.xml.stream.XMLStreamException
java.io.IOException