Splunk Search

Extract characters without digit

royimad
Builder

I have a field in the log like the following:
abc1232
ab.sadkjsakj21302139
abc3400349
alex.carl2103920

I need to extract all characters without the digital number. How to do that using regular expression? rex or interactive field extraction?

Thanks

Tags (3)
0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

If you are going to be using it repeatedly, I would place it in a props/transforms. But you can do it via search line.

|rex field=myfield "(?<no_digits>[^\d]*)"

OR with props.conf

[mysourcetype]
EXTRACT-myfield = (?<no_digits>[^\d]*) in myfield

gfuente
Motivator

Hello

You could use this regular expresion:

(?<mystring>\D+)

And using the rex command:

... | rex "(?< mystring >\D+)" | ...

*Without the spaces before and after the field name

Regards

Get Updates on the Splunk Community!

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...

Application management with Targeted Application Install for Victoria Experience

Experience a new era of flexibility in managing your Splunk Cloud Platform apps! With Targeted Application ...