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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...