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!

Stay Connected: Your Guide to December Tech Talks, Office Hours, and Webinars!

❄️ Celebrate the season with our December lineup of Community Office Hours, Tech Talks, and Webinars! ...

Splunk and Fraud

Watch Now!Watch an insightful webinar where we delve into the innovative approaches to solving fraud using the ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...