Admin Manual

 


How Splunk Works

Configure inputs via inputs.conf

This documentation does not apply to the most recent version of Splunk. Click here for the latest version.

Configure inputs via inputs.conf

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.


Configuration

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
...

Global settings

The following attributes/value pairs are valid for ALL input types


host = <string>

index = <string>

source = <string>

sourcetype = <string>

queue = <string> (parsingQueue, indexQueue, etc)

Input types

The following attributes/value pairs are valid for the specified input types only.


Tail

[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.


Wildcards

You can use wildcards to specify your input path for tail input. Use ... for paths and * for files.


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:


wildcardregexmeaning
*[^/]*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


Additional attributes

host_regex = <regular expression>

host_segment = <integer>

crcSalt = <string>

followTail = 0|1

_whitelist = <regular expression>

_blacklist = <regular expression>

Batch

[batch://<path>]

Additional attributes

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

[tcp://<remote server>:<port>]

Additional attributes

connection_host = [ip | dns]

UDP

[udp://:<port>]

Additional attributes

_rcvbuf = <int>

no_priority_stripping = <value>

FIFO

[fifo://<path>]

Scripted Input

[script://<cmd>]

interval = <integer>

passAuth = <username>

Examples

Tail

[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 (aka Watch)

[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

[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

[udp://<remote-server>:<port>]

Similar to TCP, except that Splunk listens on a UDP port.


FIFO

[fifo://<path>]

This directs Splunk to read from the FIFO at the specified path.

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 View the Article History for its revisions.


You must be logged into splunk.com in order to post comments. Log in now.

Was this documentation topic helpful?

If you'd like to hear back from us, please provide your email address:

We'd love to hear what you think about this topic or the documentation as a whole. Feedback you enter here will be delivered to the documentation team.