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!

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...