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
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 ...