Getting Data In

Is blacklist recursive

tkw03
Communicator

I have an inputs.conf stanza that I want to add. I am adding it to monitor all files and sub-directories. Throughout these sub-directories there are .bz2 files that I dont want to ingest. What would be the best way? I was thinking blacklist the bz2 files but that may not be the best way? Maybe there's a better way?

[monitor:///var/log/remote/*]
blacklist=(*.bz2*)
index=nix_os
disabled = 0

There could be any number of sub-directories below the remote/ parent directory.

Thanks!

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

The asterisk * will not recurse through subfolders. See this:
https://docs.splunk.com/Documentation/Splunk/8.0.1/Data/Specifyinputpathswithwildcards#Input_example...

I would use something like this. Assuming bz2 is the file extension

[monitor:///var/log/remote/*]
whitelist=\.bz2$
index=nix_os
disabled = 0
recursive=true           #true by default

View solution in original post

0 Karma

13tsavage
Communicator

Splunk Docs has good documentation explaining how to whitelist and blacklist file paths. The blacklist and whitelist sections requires custom regex expressions. So yes, there are ways to blacklist all files of a specific file type .bz2 in your case.

See the Blacklist (ignore) files in Whitelist or blacklist specific incoming data

0 Karma

somesoni2
SplunkTrust
SplunkTrust

The asterisk * will not recurse through subfolders. See this:
https://docs.splunk.com/Documentation/Splunk/8.0.1/Data/Specifyinputpathswithwildcards#Input_example...

I would use something like this. Assuming bz2 is the file extension

[monitor:///var/log/remote/*]
whitelist=\.bz2$
index=nix_os
disabled = 0
recursive=true           #true by default
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...