Reporting

how to calculate availability percentage within the last hour?

dhavamanis
Builder

Can you please tell us, how to calculate availability percentage using Splunk query for the below case in last one hour,

(total_event - total_5*_status_code_event)/total_event = average_availability.

Sample base query :

total_event = index="myindex"
total_5*_status_code_event = index="myindex" status="5**"

Once we get the results, need to assign this value in speedometer graph as report.

0 Karma
1 Solution

strive
Influencer

To calculate percentage try this

some search terms | eval Count5xx=if(status like "5%",1,0)  | stats sum(Count5xx) as Count5xx count(status) as Total | eval AvailablePercentage=(Total - Count5xx)*100/Total

View solution in original post

strive
Influencer

To calculate percentage try this

some search terms | eval Count5xx=if(status like "5%",1,0)  | stats sum(Count5xx) as Count5xx count(status) as Total | eval AvailablePercentage=(Total - Count5xx)*100/Total
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...