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

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...

Global Splunk User Group Events: May + June 2026

Your Splunk Community Awaits: Discover Upcoming User Group Events Worldwide    Staying ahead in the fast-paced ...