Splunk Search

How to extract all fields from my sample log and graph the average of the values?

karthikbits
New Member

Single log line:

{kpiMuleMS=12, kpiSecurityCheckMS=230, kpiGetQuoteMS=56, kpiGetLegalEntityMS=0, kpiOIILookupPersonaMS=0, kpiCreateSubscriptionMS=40, kpiGetOfferMS=0, kpiProcessSubscriptionMS=23, kpiPayAuthMS=9, kpiOIIFindRealmMS=1, kpiUpdateAccountMS=40, kpiGetAccountMS=10}

How do I graph the avg values of all the keys in a single graph?
Unfortunately, I do not have the log line in the following format..

key=kpiSecurityCheckMS latency=230
key=kpiMuleMS latency=12
0 Karma

sundareshr
Legend

Try this (if the fields are already extracted, ignore the extract segement)

base search | extract pairdelim="," kvdelim="=" | stats avg(kpiMuleMS) as kpiMuleMS avg(kpiSecurityCheckMS) as kpiSecurityCheckMS <<similarly for rest of your fields
0 Karma

mhpark
Path Finder

The kv or extract command would work well here.

But, do you want an average of each kpi,
or an average of all kpis?

Try this for the former.

| kv pairdelim="=", kvdelim=","
| fields - _raw
| stats avg(*)
0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...