Splunk Search

How to write a search to convert some table rows as columns?

vemukira000
New Member

I need to convert the following source data as a specified output.

Source Data

Hostname    Event_time             Key           Value
P153        2015/07/28 03:00:00    Total Size    2048
P153        2015/07/28 03:00:00    Used Size     797
P153        2015/07/28 03:00:00    Avail Size    1251.38
P153        2015/07/28 03:15:00    Total Size    2048
P153        2015/07/28 03:15:00    Used Size     856
P153        2015/07/28 03:15:00    Avail Size    1147.38

Need a search to convert as following

EVENT_TIME            Total Size    Used Size    Avail Size
2015/07/28 03:00:00      2048          797        1251.38
2015/07/28 03:15:00      2048          856        1147.38
0 Karma

diogofgm
SplunkTrust
SplunkTrust

try this:

| chart values(total_size) as "Total Size" values(used_size) as "Used Size" values(avail_size) as "Avail Size" over Event_time

change the field names inside the values() to match your extracted fields.

------------
Hope I was able to help you. If so, some karma would be appreciated.
Get Updates on the Splunk Community!

Celebrating Fast Lane: 2025 Authorized Learning Partner of the Year

At .conf25, Splunk proudly recognized Fast Lane as the 2025 Authorized Learning Partner of the Year. This ...

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...