Getting Data In

Monitoring the content of a configuration file

u568675
New Member

I have a client that wants to monitor a system configuration file and specifically the content of the configuration file. They would like to index the content of a file and ultimately the only index the content again when the configuration file content changes.
We've tied using "fschange" but it's only outputting the file characteristics (see below) not the file content

Tue Jun 4 10:07:32 2019 action=add, path="///opt/mapr/spark/spark-2.2.1/conf/spark-defaults.conf", isdir=0, size=1957, gid=1446, uid=930, modtime="Wed Jan 23 15:58:32 2019", mode="rw-r--r--", hash=***

the inputs.conf configuration setting for "fschange" that we've tried are:
[fschange:///opt/mapr/spark/spark-2.2.1/conf/spark-defaults.conf]

index = _audit
recurse = false
followLinks = false
signedaudit = false
fullEvent = true
sendEventMaxSize = 1048576
delayInMills = 1000***

Has someone successfully index a configuration file content and re-indexed the configuration content when the configuration content changes?

0 Karma

evania
Splunk Employee
Splunk Employee

Hi @u568675 ,

Did you have a chance to check out an answer? If it worked, please resolve this post by approving it! If your problem is still not solved, keep us updated so that someone else can help you.

Thanks for posting!

0 Karma

u568675
New Member

We added crcSalt = to the input stanza and tested by modifying the configuration file but unfortunately it do not generate an event.

0 Karma

MuS
Legend

Did you also change the stanza from [fschange:// to be [monitor:// as mentioned in my answer?

cheers, MuS

0 Karma

MuS
Legend

Hi u568675,

Well, that is what fschange (which btw is deprecated since Splunk 5.x) does:

[fschange:<path>]
* Monitors changes (such as additions, updates, and deletions) to this
  directory and any of its sub-directories.

Source https://docs.splunk.com/Documentation/Splunk/latest/admin/Inputsconf .

If you want to index config files and index when they change, you need to add a monitor stanza and add the option crcSalt = <SOURCE> to the monitor. This will re-index the file once it changes.

Hope this helps ...

cheers, MuS

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...