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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...