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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...