Getting Data In

How do I blacklist sub-directories in the input.conf file?

mo86
New Member

I want to capture all the files in a particular folder but I do not want to capture the files inside the sub-directories of that folder.

0 Karma

JDukeSplunk
Builder

So... I would do something like this

[monitor://C:\path\*(log$|txt$|csv$)]
disabled = 0
recurse = false
followTail = 0
sourcetype=YOURSOURCETYPENAME
ignoreOlderThan = 7d
index = YOURINDEX

Or specify file names. These should no recurse down the sub folders since you are specifying exact file names, or partial file names with wildcards. Filename_9-20-18.log would be written like Filename_.log$*. The $ tells it to not pickup files like Filename_DATE.log.gz

[monitor://C:\path\sourcetypeA*.file_extension$]
disabled = 0
followTail = 0
sourcetype=sourcetypeA
ignoreOlderThan = 7d
index = YOURINDEX

[monitor://C:\path\sourcetypeB*.file_extension$]
disabled = 0
followTail = 0
sourcetype=sourcetypeB
ignoreOlderThan = 7d
index = YOURINDEX

Linux paths look a little different, but the rest is about the same.

[monitor:///opt/apache-tomcat/*/logs/catalina.out]

Will grab catalina.out from /opt/apache-tomcat/8.1/logs AND /opt/apache-tomcat/8.2/logs

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...