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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...