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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...