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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...