Splunk Search

How to convert values in a table column to column headers?

trunghung
Path Finder

I have a stats table like this

Header1......Error....Count
0-24hr..........1a..........1
0-24hr..........2a..........2
0-24hr..........3a..........3
24-48hr........1a..........4
24-48hr........2a..........5
24-48hr........3a..........6

and I'd like to transform it into a table like this and I'd like to sort it by one of the columns (for example 0-24hr column)

Error 0-24hr 24-48hr
1a..........1..........4
2a..........2..........5
3a..........3..........6

How would I do that? thank you very much

0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

Append this to your search:

... | xyseries Error Header1 Count

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

Append this to your search:

... | xyseries Error Header1 Count

martin_mueller
SplunkTrust
SplunkTrust

Something like this:

... | sort "0-24hr"

Make sure to get the column name correct, including case sensitivity.

0 Karma

trunghung
Path Finder

Hi Martin,

that works. how do I sort the table by the 0-24hr column? thanks

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...