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!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...