Splunk Search

Rename columns

deanamite91
Explorer

I have the following search string

index="commercial_performance" "Efficiency Variance *" OR "Intervention Variance *" OR "Entitlement Variance *" | stats sum(Value) AS "Total" by Cat1 | addcoltotals labelfield=Cat1 label="Total (£)"

On my graph the Efficiency Entitlement and Intervention Variance columns say 'Efficiency Variance (\xA3)' when I want them to say 'Efficiency Variance (£)'.

I have tried renaming them but no luck.

Tags (2)
0 Karma

gcato
Contributor

Hi deanamite91,

Just use the "rename" command to rename your column headers.

... | rename "Efficiency Variance (xA3)" AS "Efficiency Variance (£)" ...<and so on>...
0 Karma

deanamite91
Explorer

I've tried using rename and it doesn't work.

0 Karma

deanamite91
Explorer

The field is Cat1 and the values within it are Efficiency Variance (\xA3), Intervention Variance (\xA3) and Entitlement Variance (\xA3)

0 Karma

gcato
Contributor

I suggest either the sed or the replace() commands. For example,

... | rex mode=sed "s/xA3/£/g"

OR

  ... | eval Cat1 = replace(Cat1, "xA3", "£")
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...