Splunk Search

Splunk qyery for failure status more than 10%?

karthi2809
Builder

Three type of status:
status:400
status:404
status:500

need total count and status count. if count of status more than 10% need to trigger alert?

Tags (3)
0 Karma
1 Solution

FrankVl
Ultra Champion
| your base search
| stats count AS statuscount by status
| eventstats sum(statuscount) AS totalcount
| eval percentage=statuscount/totalcount*100 
| where percentage > 10

View solution in original post

p_gurav
Champion

You can try :

 index=<your index> | eventstats count as totalcount | chart count,first(totalcount) as totalcount by status | eval percentage=round(count/totalcount*100) | where percentage > 10

FrankVl
Ultra Champion
| your base search
| stats count AS statuscount by status
| eventstats sum(statuscount) AS totalcount
| eval percentage=statuscount/totalcount*100 
| where percentage > 10
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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