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!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...