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!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...