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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...