Splunk Search

How do I get the failure status for that percentile?

karthi2809
Builder

i want to calculate failure status 404 for service name .when the status is reached 90% .I need to trigger email?

index=xxx* |eventstats count(eval(Proxy)) as "totcnt" count(eval(Status="404")) as "failurecnt" by Name |stats perc90(failurecnt) as perc90_avg by Name

Tags (2)
0 Karma

somesoni2
Revered Legend

Try this (not sure if need to use percentile, just percentage should do it)
Updated

index=xxx* 
|stats count(Proxy) as "totcnt" count(eval(Status="404")) as "failurecnt" by Name 
|eval failurepercent=failurecnt*100/totcnt | where failurepercent>90

micahkemp
Champion

Unless I'm missing something, count(eval(Proxy)) could be more simply written count(Proxy), which will give the count of values in the Proxy field.

somesoni2
Revered Legend

You're correct. Didn't look for that before. Corrected.

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 ...