Splunk Search

transpose the row to column

RSS_STT
Explorer

I want to transpose the below row to column.

Hostdrive_Nameutilization 
aaaD20 
bbbD30 
aaaE60 

 

want to covert above table result as below.

HostDE
aaa2060
bbb30 
Labels (1)
Tags (1)
0 Karma

PickleRick
SplunkTrust
SplunkTrust
0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @RSS_STT 

Use a stats command like this:

| chart values(utilization) over Host by drive_Name

livehybrid_0-1744873334688.png

 

| makeresults count=3 
| streamstats count 
| eval Host=case(count=1 OR count=3, "aaa", count=2, "bbb"), 
       drive_Name=case(count=1 OR count=2, "D:", count=3, "E:"), 
       utilization=case(count=1, 20, count=2, 30, count=3, 60) 
| fields - count _time
| chart values(utilization) over Host by drive_Name

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

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!

Thanks for the Memories: .conf26 Took Learning to New Heights

Thank you, Splunk Community, for making .conf26 in Denver one for the books. From packed Splunk University ...

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...