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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...