Splunk Search

Calculating Sum of Percentages for Radial Gauge

evanleair
Explorer

Hi Splunk Masters,

I am new here and I'm building out a radial gauge for successful HTTP requests. I am counting 300 and 200 responses as successful. I have a search built out, but it is showing each responses value. Example below:

sourcetype=iis_logs http_status!=40* http_status!=5* UserAgent=UserAgent0* OR UserAgent=UserAgent1* | eventstats count as "totalCount" | eventstats count as "http_statusCount" by http_status| eval percent=(http_statusCount/totalCount)*100 | stats values(percent)| sort -values(percent)

This works out great in getting the information I need, but just need to find a way to add each value up as a total response. So instead of it showing 97.123, 1.123 and .045 it'll show a flat value of 98.29100.

Thanks

Tags (1)
0 Karma
1 Solution

sundareshr
Legend

Try this

 sourcetype=iis_logs UserAgent=UserAgent0* OR UserAgent=UserAgent1* | stats count as total count(eval(http_status<400)) as success | eval perc=success/total*100 | fields perc

View solution in original post

sundareshr
Legend

Try this

 sourcetype=iis_logs UserAgent=UserAgent0* OR UserAgent=UserAgent1* | stats count as total count(eval(http_status<400)) as success | eval perc=success/total*100 | fields perc

evanleair
Explorer

This worked! Thank you so much for your collaboration. Much appreciated.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...