Getting Data In

Filter an event where first 2 characters are in uppercase

vishalduttauk
Path Finder

I am ingesting a text file and I have created a field called Flag. I am looking to create a filter which only shows me events where the first two characters of that field are in capitals.

 

I.e. I want to see event where Flag is VMs, SVictor, ARev but not Amy, Fox or Dana.

 

Can you help?

Labels (2)
Tags (3)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Try the regex command.

index = foo
| regex Flag="^[A-Z]{2}"
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Try the regex command.

index = foo
| regex Flag="^[A-Z]{2}"
---
If this reply helps you, Karma would be appreciated.

vishalduttauk
Path Finder

Thanks! This has worked a treat

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...