Splunk Search

How do you remove the first row and get same table as it is when used transpose?

snallam123
Path Finder

My query is

index=_internal source=*metrics.log 
| search series!=_*  group="per_index_thruput"   
| eval GB=kb/(1024*1024)  
| timechart span=1d limit=0 sum(GB) by series
| transpose

I am getting the result

column      row 1               row 2
_time        1553644800       1553731200
index1      0.0000003         0.000002
index2      0.00077             0.00379
index3      0.001077            0.005314

I am looking to replace row 1 and row 2 with days

column   03/28/2019          03/28/2019
   index1     0.0000003         0.000002
index2   0.0007               0.0037
index3   0.00107            0.0053

Can any one help on this?

0 Karma
1 Solution

vnravikumar
Champion

Hi

Give a try

index=_internal source=*metrics.log 
| search series!=_* group="per_index_thruput" 
| eval GB=kb/(1024*1024) 
| timechart span=1d limit=0 sum(GB) by series 
| eval temp=strftime(_time,"%m-%d-%Y") 
| transpose 0 header_field=temp 
| where column!="_time"

View solution in original post

vnravikumar
Champion

Hi

Give a try

index=_internal source=*metrics.log 
| search series!=_* group="per_index_thruput" 
| eval GB=kb/(1024*1024) 
| timechart span=1d limit=0 sum(GB) by series 
| eval temp=strftime(_time,"%m-%d-%Y") 
| transpose 0 header_field=temp 
| where column!="_time"

snallam123
Path Finder

Thanks, @vnravikumar , This is exactly what i need.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...