Splunk Search

How to change table column headings?

ny34940
Path Finder

The search command that I have used is:
| chart list(field1) as A list(field2) as B by name month

The result I am getting is something like this
Name A : JAN A : FEB A : MAR B : JAN B : FEB B : MAR
abc

xyz

Desired result:

NAME JAN : A JAN : B FEB : A FEB : B MAR : A MAR : B
abc

xyz

I know the reason why I am getting the result but is there any way to change the names like the desired one?
Thanks in advance.

0 Karma
1 Solution

mayurr98
Super Champion

hey try this

<your_base_query> | chart list(field1) as A list(field2) as B over name by month | rename A:* as *:A B:* as *:B 

let me know if this helps!

View solution in original post

mayurr98
Super Champion

hey try this

<your_base_query> | chart list(field1) as A list(field2) as B over name by month | rename A:* as *:A B:* as *:B 

let me know if this helps!

ny34940
Path Finder

Thank you,it worked.

0 Karma

andrey2007
Contributor

Try to use rename

[your_search] | rename "A:*" as "*:A", "B:*" as "*:B"

ny34940
Path Finder

Thanks for the answer

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...