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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

A Four-Part Event Series: Full Stack Observability For the AI Era

As AI reshapes applications, infrastructure, and the way teams operate, the traditional boundaries of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...