Splunk Search

Splunk qyery for failure status more than 10%?

karthi2809
Contributor

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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...