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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...