This documentation does not apply to the most recent version of Splunk.
This documentation applies to the following versions of Splunk: 3.2 , 3.2.1 , 3.2.2 , 3.2.3 , 3.2.4 , 3.2.5 , 3.2.6
Add data inputs via inputs.conf. This allows for more granularity in your configuration than setting up inputs via SplunkWeb or the CLI.
Note: To set dynamic indexing properties for inputs, use props.conf.
Add your stanza to $SPLUNK_HOME/etc/bundles/local/inputs.conf. Specify an input type and any number of attribute/value pairs.
[<inputtype>://<path>] attribute1 = val1 attribute2 = val2 ...
The following attributes/value pairs are valid for ALL input types
host = <string>
index = <string>
source = <string>
sourcetype = <string>
queue = <string> (parsingQueue, indexQueue, etc)
The following attributes/value pairs are valid for the specified input types only.
[tail://<path>]
This directs Splunk to watch all files in the <path> (or just <path> itself if it represents a single file). You must specify the input type and then the path, so put three slashes in your path if you're starting at root. You can use wildcards for the path; see below.
Note: To ensure new events are indexed when you copy over an existing file with new contents, set CHECK_METHOD = modtime in props.conf for the source. This checks the modtime of the file and re-indexes when it changes. Note that the entire file is indexed, which can result in duplicate events.
You can use wildcards to specify your input path for tail input. Use ... for paths and * for files.
... recurses through directories until the match is met. This means that /foo/.../bar will match foo/bar, foo/1/bar, foo/1/2/bar, etc. but only if bar is a file.
.... For example /foo/.../bar/....
* matches anything in that specific path segment. It cannot be used inside of a directory path; it must be used in the last segment of the path. For example /foo/*.log matches /foo/bar.log but not /foo/bar.txt or /foo/bar/test.log.
* and ... for more specific matches:
foo/.../bar/* matches any file in the bar directory within the specified path.
Note: In Windows, you must use two backslashes \\ to escape wildcards. Regexes with backslashes in them are not currently supported for _whitelist and _blacklist in Windows.
Specifying wildcards results in an implicit _whitelist created for that stanza. The longest fully qualified path is used as the tail stanza, and the wildcards are translated into regular expressions using the following map:
| wildcard | regex | meaning |
* | [^/]* | anything but / |
... | .* | anything (greedy) |
. | \. | literal . |
For example, if you specify
[tail:///foo/bar*.log]
Splunk translates this into
[tail:///foo/] _whitelist = bar[^/]*\.log
As a consequence, you can't have multiple stanzas with wildcards for files in the same directory.
For example:
[tail:///foo/bar_baz*] [tail:///foo/bar_qux*]
This results in overlapping stanzas indexing the directory /foo/. Splunk takes the first one, so only files starting with /foo/bar_baz will be indexed. To encompass both sources, manually specify a _whitelist using regular expression syntax for "or":
[tail:///foo] _whitelist = (bar_baz[^/]*|bar_qux[^/]*)
Note: To set any additional attributes (such as sourcetype) for multiple whitelisted/blacklisted inputs that may have different attributes, use props.conf
host_regex = <regular expression>
host_segment = <integer>
crcSalt = <string>
followTail = 0|1
_whitelist = <regular expression>
_blacklist = <regular expression>
[batch://<path>]
move_policy = (passive_symlink, passive_copy, sinkhole)
host_regex (see tail)
host_segment (see tail)
Note: source = <string> and <KEY> = <string> are not used by batch.
[tcp://<remote server>:<port>]
connection_host = [ip | dns]
[udp://:<port>]
_rcvbuf = <int>
no_priority_stripping = <value>
[fifo://<path>]
[script://<cmd>]
$SPLUNK_HOME/etc/bundles/$YOUR_BUNDLE/bin directory.
interval = <integer>
passAuth = <username>
[tail:///apache/.../logs]
This loads anything in /apache/foo/logs or /apache/bar/logs, etc.
[tail:///apache/*.log]
This loads anything in /apache/ that ends in .log.
[batch://system/flight815/*] move_policy = sinkhole
This example batch loads all files from the directory /system/flight815/. move_policy = sinkhole deletes the files from the directory.
[tcp://<remote server>:<port>]
This configures Splunk to listen on the specified port. If a connection is made from <remote server>, this stanza is used to configure the input.
If <remote server> is blank, this stanza matches all connections on the specified port.
[udp://<remote-server>:<port>]
Similar to TCP, except that Splunk listens on a UDP port.
[fifo://<path>]
This directs Splunk to read from the FIFO at the specified path.