Splunk Search

correct regex for whitelisting files

jalfrey
Communicator

I have files that have names like this:
appflow-0017c569f354.syslog-dynamic-96
appflow-0017c569f354.syslog-dynamic-97
appflow-0017c569f354.syslog-dynamic-102
...

I tried the following regex:

appflow-+[0-9a-z]{12}+.syslog-dynamic-+[0-9]{1,6}

but splunk was not indexing any of the files. What is the correct regex?

0 Karma
1 Solution

kristian_kolb
Ultra Champion

I would suggest;

appflow-[a-z0-9]{12}\.syslog-dynamic-\d+

which is probably precise enough.

/K

View solution in original post

JensT
Communicator

Hi,

Also an idea:

appflow-[^\.]+\.syslog-dynamic-\d+

-- Jens

0 Karma

kristian_kolb
Ultra Champion

I would suggest;

appflow-[a-z0-9]{12}\.syslog-dynamic-\d+

which is probably precise enough.

/K

jalfrey
Communicator

Thanks for the speedy response.

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