com.splunk
Class ScriptInput

java.lang.Object
  extended by com.splunk.Resource
      extended by com.splunk.Entity
          extended by com.splunk.Input
              extended by com.splunk.ScriptInput
All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.Object>

public class ScriptInput
extends Input

The ScriptInput class represents a scripted data input.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class com.splunk.Entity
content, toUpdate
 
Fields inherited from class com.splunk.Resource
actions, path, refreshArgs, service, title
 
Method Summary
 java.util.Date getEndTime()
          Returns the time when the scripted input stopped running.
 java.lang.String getGroup()
          Returns the OS group of commands for this scripted input.
 java.lang.String getHost()
          Returns the source host for this scripted input.
 java.lang.String getIndex()
          Returns the index name for this scripted input.
 java.lang.String getInterval()
          Returns the frequency for running this scripted input.
 InputKind getKind()
          Returns the input kind for this scripted input.
 java.lang.String getPassAuth()
          Returns the username that this scripted input runs under.
 int getRcvBuf()
          Deprecated. Returns the value of the _rcvbuf attribute for this scripted input.
 java.lang.String getSource()
          Returns the source of events from this scripted input.
 java.lang.String getSourceType()
          Returns the source type of events from this scripted input.
 java.util.Date getStartTime()
          Returns the time when the script was started.
 void setDisabled(boolean disabled)
          Sets whether the scripted input is enabled or disabled.
 void setHost(java.lang.String host)
          Sets the value for the host field for events from this scripted input.
 void setIndex(java.lang.String index)
          Sets the index in which to store events from this scripted input.
 void setInterval(java.lang.String interval)
          Sets an interval or a cron schedule that determines when to run the script.
 void setPassAuth(java.lang.String passAuth)
          Sets a username to run the script under.
 void setRenameSource(java.lang.String name)
          Sets the source name for events from this scripted input.
 void setSource(java.lang.String source)
          Sets the initial value for the source key for events from this input.
 void setSourcetype(java.lang.String sourcetype)
          Sets the source type for events from this scripted input.
 
Methods inherited from class com.splunk.Entity
actionPath, clear, containsKey, containsValue, disable, enable, entrySet, get, getContent, getMetadata, isDisabled, isEmpty, isNameChangeAllowed, keySet, put, putAll, refresh, remove, remove, size, update, update, validate, values
 
Methods inherited from class com.splunk.Resource
getName, getPath, getService, getTitle, invalidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Method Detail

getEndTime

public java.util.Date getEndTime()
Returns the time when the scripted input stopped running.

Returns:
The ending time, or null if not specified.

getGroup

public java.lang.String getGroup()
Returns the OS group of commands for this scripted input.

Returns:
The group of commands, or null if not specified.

getHost

public java.lang.String getHost()
Returns the source host for this scripted input.

Returns:
The source host, or null if not specified.

getIndex

public java.lang.String getIndex()
Returns the index name for this scripted input.

Returns:
The index name.

getInterval

public java.lang.String getInterval()
Returns the frequency for running this scripted input.

Returns:
The frequency, in seconds or a cron schedule.

getKind

public InputKind getKind()
Returns the input kind for this scripted input.

Overrides:
getKind in class Input
Returns:
The input kind.

getPassAuth

public java.lang.String getPassAuth()
Returns the username that this scripted input runs under.

Returns:
The username.

getRcvBuf

public int getRcvBuf()
Deprecated. Returns the value of the _rcvbuf attribute for this scripted input.

Returns:
The _rcvbuf value.

getSource

public java.lang.String getSource()
Returns the source of events from this scripted input.

Returns:
The source.

getSourceType

public java.lang.String getSourceType()
Returns the source type of events from this scripted input.

Returns:
The source type.

getStartTime

public java.util.Date getStartTime()
Returns the time when the script was started.

Returns:
The start time, or null if not specified.

setDisabled

public void setDisabled(boolean disabled)
Sets whether the scripted input is enabled or disabled.

Note: Using this method requires you to restart Splunk before this setting takes effect. To avoid restarting Splunk, use the Entity.disable and Entity.enable methods instead, which take effect immediately.

Parameters:
disabled - true to disable the input, false to enable it.

setHost

public void setHost(java.lang.String host)
Sets the value for the host field for events from this scripted input.

Parameters:
host - The host.

setIndex

public void setIndex(java.lang.String index)
Sets the index in which to store events from this scripted input.

Parameters:
index - The index name.

setInterval

public void setInterval(java.lang.String interval)
Sets an interval or a cron schedule that determines when to run the script. If a cron schedule is used, the script doesn't run at startup.

Parameters:
interval - An interval, in seconds or a cron schedule.

setPassAuth

public void setPassAuth(java.lang.String passAuth)
Sets a username to run the script under. Splunk generates an authorization token for the username and passes it to the script.

Parameters:
passAuth - The username.

setRenameSource

public void setRenameSource(java.lang.String name)
Sets the source name for events from this scripted input. The same source should not be used for multiple data inputs.

Parameters:
name - The source name.

setSource

public void setSource(java.lang.String source)
Sets the initial value for the source key for events from this input. The source key is used during parsing and indexing. The source field is used for searches. As a convenience, the source string is prepended with "source::".

Note: Overriding the source key is generally not recommended. Typically, the input layer provides a more accurate string to aid in problem analysis and investigation, accurately recording the file from which the data was retrieved. Consider the use of source types, tagging, and search wildcards before overriding this value.

Parameters:
source - The source.

setSourcetype

public void setSourcetype(java.lang.String sourcetype)
Sets the source type for events from this scripted input.

Parameters:
sourcetype - The source type.