Admin Manual

 


About the Splunk 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 is useful for tracking changes in your file system. The file system change monitor watches any directory you specify and generates an event (in Splunk) 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 tell the file system change monitor to watch /etc/sysconfig/ and alert you any time the system's configurations are changed.


Configure file system change monitor in inputs.conf.


Note: You cannot currently use both monitor and file system change monitor to follow the same directory or file. If you want to see changes in a directory, use file system change monitor. If you want to index new events in a directory, use monitor.


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/system/local/. Edit this files in $SPLUNK_HOME/etc/system/local/, or your own custom application directory in $SPLUNK_HOME/etc/apps/. For more information on configuration files in general, see how configuration files work.


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>
filters=<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


signedaudit=<true | false>

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


fullEvent=<true | false>


sendEventMaxSize=N

sourcetype = <string>


filesPerDelay = <integer>

delayInMills = <integer>


filters=<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] 
filters = backups,code 

This documentation applies to the following versions of Splunk: 3.3.3 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!