Splunk Search

Rename values with regex

widad_guerrida
Engager

Hello,
I need to delete the numericals values in variables name :
CETAT_UGE_11 become CETAT_UGE
knowing that I have many variables like this, so i need a solution that works for all of them.

I started doing this : | rex result = column "([0-9]{2-3})" , with column is a column of a table which contains CETAT_UGE_11 and others.
but it does not work : Error in 'rex' command: The regex 'hfield' does not extract anything. It should specify at least one named group. Format: (?...).

Thank you for helping me

0 Karma

to4kawa
Ultra Champion
| makeresults
| fillnull CETAT_UGE_11 CETAT_UGF_12 CETAT_UGG_13 CETAT_UGH_14
| foreach *_*_* [ eval <<MATCHSEG1>>_<<MATCHSEG2>> = '<<FIELD>>'
| fields - <<FIELD>>]
0 Karma
Get Updates on the Splunk Community!

Observability | How to Think About Instrumentation Overhead (White Paper)

Novice observability practitioners are often overly obsessed with performance. They might approach ...

Cloud Platform | Get Resiliency in the Cloud Event (Register Now!)

IDC Report: Enterprises Gain Higher Efficiency and Resiliency With Migration to Cloud  Today many enterprises ...

The Great Resilience Quest: 10th Leaderboard Update

The tenth leaderboard update (11.23-12.05) for The Great Resilience Quest is out &gt;&gt; As our brave ...