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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...