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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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