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 Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...