com.splunk
Class MonitorInput

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

public class MonitorInput
extends Input

The MonitorInput class represents a monitor input, which is a file, directory, script, or network port that is monitored for new data.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 java.lang.String getBlacklist()
          Returns a regular expression for a file path that when matched is not indexed.
 java.lang.String getCrcSalt()
          Returns a string that is used to force Splunk to index files that have a matching cyclic redundancy check (CRC).
 int getFileCount()
          Returns the file count of this monitor input.
 boolean getFollowTail()
          Indicates whether files that are seen for the first time will be read from the end.
 java.lang.String getHost()
          Returns the host for this monitor input.
 java.lang.String getHostRegex()
          Returns the regular expression for a file path to determine the host.
 java.lang.String getIgnoreOlderThan()
          Returns a time value that defines a rolling time window for monitoring files.
 java.lang.String getIndex()
          Gets the index where events from this monitor input are stored.
 InputKind getKind()
          Returns the type of monitor input.
 java.lang.String getQueue()
          Returns the queue for this monitor input.
 int getRcvBuf()
          Deprecated. Returns the value of the _rcvbuf attribute for this monitor input.
 boolean getRecursive()
          Indicates whether sub-directories are monitored within this monitor input.
 java.lang.String getSource()
          Returns the source of events from this monitor input.
 java.lang.String getSourceType()
          Returns the source type of events from this monitor input.
 int getTimeBeforeClose()
          Returns the time period for keeping a file open.
 java.lang.String getWhitelist()
          Returns a regular expression for a file path that, when matched, is indexed.
 void setBlacklist(java.lang.String blacklist)
          Sets a regular expression for a file path that, when matched, is not indexed.
 void setCheckIndex(boolean index)
          Sets whether the index value is checked to ensure that it is the name of a valid index.
 void setCheckPath(boolean path)
          Sets whether the name value is checked to ensure that it exists.
 void setCrcSalt(java.lang.String salt)
          Sets a string that is used to force Splunk to index files that have a matching cyclic redundancy check (CRC).
 void setFollowTail(boolean followTail)
          Sets whether files that are seen for the first time will be read from the end.
 void setHost(java.lang.String host)
          Sets the value to populate in the host field for events from this monitor input.
 void setHostRegex(java.lang.String regex)
          Set the regular expression for a file path to determine the host.
 void setHostSegment(java.lang.String segment)
          Sets the specified slash-separate segment of the file path as the host field value.
 void setIgnoreOlderThan(java.lang.String time)
          Sets a time value that defines a rolling time window for monitoring files.
 void setIndex(java.lang.String index)
          Sets the index where events from this monitor input are stored.
 void setRecursive(boolean recursive)
          Sets whether to monitor sub-directories within this monitor input.
 void setRenameSource(java.lang.String name)
          Sets the name to populate in the source field for events from this monitor input.
 void setSourcetype(java.lang.String sourcetype)
          Sets the source type to populate in the sourcetype field for events from this monitor input.
 void setTimeBeforeClose(int period)
          Sets the time period for keeping a file open.
 void setWhitelist(java.lang.String whitelist)
          Sets a regular expression for a file path that, when matched, is indexed.
 
Methods inherited from class com.splunk.Entity
clear, containsKey, containsValue, disable, enable, entrySet, get, getMetadata, isDisabled, isEmpty, 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Method Detail

getBlacklist

public java.lang.String getBlacklist()
Returns a regular expression for a file path that when matched is not indexed.

Returns:
The regex for a file path.

getCrcSalt

public java.lang.String getCrcSalt()
Returns a string that is used to force Splunk to index files that have a matching cyclic redundancy check (CRC). When set, this string is added to the CRC. If the string is "<SOURCE>", the full source path is added to the CRC, ensuring that each file being monitored has a unique CRC. For more info, see the Edit inputs.conf topic in the Getting Data In manual.

Returns:
The string that is added to the CRC, or null if not set.

getFileCount

public int getFileCount()
Returns the file count of this monitor input.

Returns:
The file count.

getFollowTail

public boolean getFollowTail()
Indicates whether files that are seen for the first time will be read from the end.

Returns:
true if new files are read from the end, false if not.

getHost

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

Returns:
The host, or null if not specified.

getHostRegex

public java.lang.String getHostRegex()
Returns the regular expression for a file path to determine the host. If the path for a file matches this regular expression, the captured value is used to populate the host field for events from this monitor input. The regular expression must have one capture group.

Returns:
The regular expression for a file path.

getIgnoreOlderThan

public java.lang.String getIgnoreOlderThan()
Returns a time value that defines a rolling time window for monitoring files. If the modification time of a file being monitored falls outside of this rolling time window, the file is no longer being monitored.

Returns:
The time value.

getIndex

public java.lang.String getIndex()
Gets the index where events from this monitor input are stored.

Returns:
The index name.

getKind

public InputKind getKind()
Returns the type of monitor input.

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

getQueue

public java.lang.String getQueue()
Returns the queue for this monitor input. Valid values are "parsingQueue" and "indexQueue".

Returns:
The queue, or null if not specified.

getRecursive

public boolean getRecursive()
Indicates whether sub-directories are monitored within this monitor input.

Returns:
true if sub-directories are monitored, false if not.

getRcvBuf

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

Returns:
The _rcvbuf value.

getSource

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

Returns:
The source name.

getSourceType

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

Returns:
The source type.

getTimeBeforeClose

public int getTimeBeforeClose()
Returns the time period for keeping a file open.

Returns:
The time to keep a file open, in seconds.

getWhitelist

public java.lang.String getWhitelist()
Returns a regular expression for a file path that, when matched, is indexed.

Returns:
The regular expression for a file path.

setBlacklist

public void setBlacklist(java.lang.String blacklist)
Sets a regular expression for a file path that, when matched, is not indexed.

Parameters:
blacklist - The regular expression for a file path.

setCheckIndex

public void setCheckIndex(boolean index)
Sets whether the index value is checked to ensure that it is the name of a valid index.

Parameters:
index - true to verify index, false if not.

setCheckPath

public void setCheckPath(boolean path)
Sets whether the name value is checked to ensure that it exists.

Parameters:
path - true to verify name, false if not.

setCrcSalt

public void setCrcSalt(java.lang.String salt)
Sets a string that is used to force Splunk to index files that have a matching cyclic redundancy check (CRC). When set, this string is added to the CRC. If the string is "<SOURCE>", the full source path is added to the CRC, ensuring that each file being monitored has a unique CRC. For more info, see the Edit inputs.conf topic in the Getting Data In manual.

Parameters:
salt - The string that is added to the CRC.

setFollowTail

public void setFollowTail(boolean followTail)
Sets whether files that are seen for the first time will be read from the end.

Parameters:
followTail - true to read new files from the end, false if not.

setHost

public void setHost(java.lang.String host)
Sets the value to populate in the host field for events from this monitor input.

Parameters:
host - The value for the host field.

setHostRegex

public void setHostRegex(java.lang.String regex)
Set the regular expression for a file path to determine the host. If the path for a file matches this regular expression, the captured value is used to populate the host field for events from this monitor input. The regular expression must have one capture group.

Parameters:
regex - The regular expression for a file path.

setHostSegment

public void setHostSegment(java.lang.String segment)
Sets the specified slash-separate segment of the file path as the host field value.

Parameters:
segment - The slash-separate segment.

setIgnoreOlderThan

public void setIgnoreOlderThan(java.lang.String time)
Sets a time value that defines a rolling time window for monitoring files. If the modification time of a file being monitored falls outside of this rolling time window, the file is no longer being monitored.

Parameters:
time - The time value.

setIndex

public void setIndex(java.lang.String index)
Sets the index where events from this monitor input are stored.

Parameters:
index - The index name.

setRecursive

public void setRecursive(boolean recursive)
Sets whether to monitor sub-directories within this monitor input.

Parameters:
recursive - true to monitor sub-directories, false if not.

setRenameSource

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

Parameters:
name - The source name.

setSourcetype

public void setSourcetype(java.lang.String sourcetype)
Sets the source type to populate in the sourcetype field for events from this monitor input.

Parameters:
sourcetype - The source type.

setTimeBeforeClose

public void setTimeBeforeClose(int period)
Sets the time period for keeping a file open.

Parameters:
period - The time to keep a file open, in seconds.

setWhitelist

public void setWhitelist(java.lang.String whitelist)
Sets a regular expression for a file path that, when matched, is indexed.

Parameters:
whitelist - The regular expression for the file path.