Getting Data In

How to filter out any directory starts out with "."

vincenty
Explorer

I am monitoring a series of directories. I want to blacklist any (sub)directories that is starting with a ".".

i.e.
/home/logs/dir1/dir2/.zfs/...
/home/logs/dir1/dir2/dir3/.snapshot/...

I can't seem to get a blacklist regex working for "any directory starting with a ."

[monitor:///home/logs/dir1/]
blacklist = \/.*

Tags (1)
0 Karma

kristian_kolb
Ultra Champion

/.* would match any character, 0 or more times. This would match all your files/dirs most likely.

Try /\.[^/]+/

Should mean 'slash, literal dot, not-slash (1 or more), slash'

/K

0 Karma

BobM
Builder

Blacklists and whitelists use perl compatible regular expressions (PCRE) so you need to change the blacklist. Replace . with \. and * with .*

try

blacklist = /\..*
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!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...