Splunk Search

How do I get specific, but separate count of letters and numbers in a result?

Shaurdonnay
Engager

I am trying to figure out how to pull fields to show the exact count of numbers and letters in a result. Like, if I have the result 11tt3yyy1, I want the fields to show me that there is 4 numbers and 5 letters. Is there a way to do this? I have tried everything I can think of.

Labels (5)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| makeresults
| eval _raw="11tt3yyy1"
| rex max_match=0 "(?<digit>[[:digit:]])|(?<letter>[[:alpha:]])"
| eval digits=mvcount(digit)
| eval letters=mvcount(letter)

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| makeresults
| eval _raw="11tt3yyy1"
| rex max_match=0 "(?<digit>[[:digit:]])|(?<letter>[[:alpha:]])"
| eval digits=mvcount(digit)
| eval letters=mvcount(letter)
0 Karma

Shaurdonnay
Engager

Perfect! Thank you very much!

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...