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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...