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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...