Admin Manual

 


How Splunk Works

File system change monitor

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

File system change monitor

Splunk's file system change monitor lets you watch any directory you specify and generates an event when that directory undergoes any change. It is completely configurable and can detect when any file on the system is edited, deleted or added (not just Splunk-specific files). For example, you can specify that the file system change monitor watch /etc/sysconfig/ and alert you any time the entire system's configurations are changed.


How the file system change monitor works

The file system change monitor detects changes using:


You can configure the following features of the file system change monitor:


Configure the file system change monitor

By default, the file system change monitor will generate events whenever the contents of $SPLUNK_HOME/etc/ are changed, deleted, or added to. When you start Splunk for the first time, an add audit event will be generated for each file in the $SPLUNK_HOME/etc/ directory and all sub-directories. Any time after that, any change in configuration (regardless of origin) will generate an audit event for the affected file(s). The audit event will be indexed into the audit index (index=_audit).


You can use the file system change monitor to watch any directory by adding a stanza to inputs.conf.


Create your own inputs.conf in $SPLUNK_HOME/etc/bundles/local/ (or your own custom bundle). You can copy the default inputs.conf from $SPLUNK_HOME/etc/bundles/default/ in to $SPLUNK_HOME/etc/bundles/local/. Do not edit the copy in default.


Edit the [fschange] stanza to configure the file system change monitor. Every setting is optional except the stanza name fschange:<directory or file to monitor>.


Note: Additions or changes to the [fschange] stanza require a restart of the Splunk Server.


[fschange:<directory or file to monitor>]
index=<indexname>
recurse=<true | false>
followLinks=<true | false>
pollPeriod=N
hashMaxSize=N
fullEvent=<true | false>
sendEventMaxSize=N
signedaudit=<true | false>
filter=<filter1>,<filter2>,...<filterN> 

Possible attribute/value pairs

[fschange:<directory or file to monitor>]


index=<indexname>

recurse=<true | false>


followLinks=<true | false>

Caution: If you are not careful with setting followLinks, file system loops may occur.


pollPeriod=N

hashMaxSize=N


fullEvent=<true | false>


sendEventMaxSize=N


signedaudit=<true | false>

Note: When setting signedaudit to true, make sure auditing is enabled in audit.conf.



filter=<filter1>,<filter2>,...<filterN>

Each of these filters will apply from left to right for each file or directory that is found during the monitors poll cycle.


To define a filter, add a [filter...] stanza as follows:


[filter:blacklist:backups] 
regex1 = .*bak
regex2 = .*bk
[filter:blacklist:code] 
regex1 = .*\.c 
regex1 = .*\.h 
 
[fschange:/etc] 
filter = backups,code 

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.

Feedback submitted, thanks!