Splunk Search

How do I use the transpose command header_field argument to reformat my table?

splk_clheureux
Explorer

I have a table from a timechart like this :

Month         LE11         LE12          LE41
January       1680         5218          1241
February      3949         3427          2850
March         3548         1307          6016

My goal is:

          January       February       March          
LE11      1680          3949           3548           
LE12      5218          3427           1307            
LE41      1241          2850           6016

I actually use a trick with rename to obtain correct columns names, but I think it makes my search longer (got 12 columns). I read on Splunk docs, there is a header_field option, but it seems like it doesn't work. I don't really understand how this option works.

Forgive my poor English, thanx a lot.

0 Karma
1 Solution

sundareshr
Legend

Have you looked at untable and xyseries commands. You can achieve what you are looking for with these two commands

View solution in original post

fdi01
Motivator
0 Karma

sundareshr
Legend

Have you looked at untable and xyseries commands. You can achieve what you are looking for with these two commands

splk_clheureux
Explorer

Thank you but I tried these two commands and the problem is that they do not show the columns with values 0 or empty

0 Karma

splk_clheureux
Explorer

This is work. Thank you

0 Karma

jluo_splunk
Splunk Employee
Splunk Employee

Hi splk_clheureux,

The header_field option is actually meant to specify which field you would like to make your header field. For example, you are transposing your table such that the months are now the headers (or column names), when they were previously LE11, LE12, etc..

However, there may be a way to rename earlier in your search string. This depends on which commands you are using. Hope this helps!

0 Karma

splk_clheureux
Explorer

Thank you for answer, I tried to use this option by setting header field=month but it doesn't work.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...