Getting Data In

Help with regex whitelist

a212830
Champion

Hi,

I need to whitelist files that match this format in a directory. Hoping someone can help me....

WebAPIServ_RTP_L1.20160102_171339_084.log
WebAPIServ_RTP_L2.20160216_225645_002.log
WebAPIServ_MMK_L1.20160102_171339_084.log
WebAPIServ_MMK_L2.20160216_225645_022.log
WebAPIServ_OMA_L1.20160102_171339_084.log
WebAPIServ_OMA_L2.20160216_225645_022.log

0 Karma
1 Solution

ejharts2015
Communicator

If you're looking for just regex, depending on how specific you want it. Something like this might work:

WebAPIServ_[A-Z]{3}_L(1|2)\.\d{8}_\d{6}_\d{3}.log

View solution in original post

ejharts2015
Communicator

If you're looking for just regex, depending on how specific you want it. Something like this might work:

WebAPIServ_[A-Z]{3}_L(1|2)\.\d{8}_\d{6}_\d{3}.log

sloshburch
Splunk Employee
Splunk Employee

Good places to play and define your regex:
http://www.regexr.com/
https://regex101.com/

0 Karma

a212830
Champion

Awesome. Great example as well.

Thanks!

0 Karma

ejharts2015
Communicator

Yup. Happy to help. If it works for you please accept as the answer. Thanks!

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