Getting Data In

Splunk Monitoring

siva_cg
Path Finder

Hi.

I have configured two monitor stanzas with whitelist and blacklist attributes to index application logs from an AIS server. The monitor stanzas will look as below:

[monitor:///opt/users/siva/logs/]
whitelist = (ac|bd|eg|fh).access.log$
blacklist = (.\d+|.gz)$
index = main
sourcetype = accesslogs
recursive = true

[monitor:///opt/users/siva/logs/system_logs/]
whitelist = (xyz|uv|pqr).log$
blacklist = (.\d+|.gz)$
index = main
sourcetype = systemlogs
recursive = true

With these configurations, Splunk didn't monitor and index any logs. But when I changed the blacklist attribute value to blacklist = .(gz|\d+) resulted in indexing the logs to Splunk. Even if the regular expression for the blacklist result the same, we didn't get the logs for first one and got the results for the second.

Is there any format or syntax to be used for the blacklist attribute?

Thanks in advance.

0 Karma
1 Solution

lguinn2
Legend

Blacklists and whitelists are unanchored regular expressions. In regular expressions the period (.) is a wild-card representing a single character. If you want to specify the period, it should be "escaped" with a backslash like this example

blacklist=.\d+$

which means "do not index any file whose name ends in a period followed by one or more digits."

View solution in original post

0 Karma

lguinn2
Legend

Blacklists and whitelists are unanchored regular expressions. In regular expressions the period (.) is a wild-card representing a single character. If you want to specify the period, it should be "escaped" with a backslash like this example

blacklist=.\d+$

which means "do not index any file whose name ends in a period followed by one or more digits."

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...