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!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...