Getting Data In

Break script output into top values on multi value keys

scalexan62
Engager

I have a script that produces output like the following:

foo=abc, bar=efg, size=100
foo=abc, bar=kkk, size=102
foo=cba, bar=fff, size=110
foo=cba, bar=ppp, size=90
foo=aaa, bar=bbb, size=95

I like to now get a chart showing the top values something like this:

foo/bar                size
-------                ----
cba/fff                110
abc/kkk                102
abc/efg                100
aaa/bbb                 95
cba/ppp                 90

Any suggestions. Do I need to break this up into separate events?

Tags (1)
0 Karma

sbrant_tt
Explorer

I think this will work for you:

 | multikv noheader=t | rex field=Column_1 "foo=(?<foo>.*)" | rex field=Column_2 "bar=(?<bar>.*)" | rex field=Column_3 "size=(?<size>.*)" | eval "foo/bar"=foo."/".bar | top size by foo/bar showcount=f showperc=f
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...