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!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...