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 worksThe file system change monitor detects changes using:
You can configure the following features of 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>
[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>
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
Comments
No comments have been submitted.