Splunk Search

How to calculate successful percentage grouped by another field?

csahoo
Explorer
0 Karma
1 Solution

somesoni2
Revered Legend

Give this a try (and may be post your question as text instead of picture next time😁 )

Your Base search
| where status="Received" OR status="Success"
| stats count(eval(status="Received")) as Received count(eval(status="Success")) as Success by sourceNodeCode labelType
| eval SuccessRate=round((Success*100)/ Received,2)
| stats list(labelType) as labelType list(Received) as GenerationCount list(SuccessRate) as "SuccessRate%" by sourceNodeCode

  

View solution in original post

csahoo
Explorer

Thank you very much  @ITWhisperer @somesoni2 both the queries are working fine

0 Karma

somesoni2
Revered Legend

Give this a try (and may be post your question as text instead of picture next time😁 )

Your Base search
| where status="Received" OR status="Success"
| stats count(eval(status="Received")) as Received count(eval(status="Success")) as Success by sourceNodeCode labelType
| eval SuccessRate=round((Success*100)/ Received,2)
| stats list(labelType) as labelType list(Received) as GenerationCount list(SuccessRate) as "SuccessRate%" by sourceNodeCode

  

ITWhisperer
SplunkTrust
SplunkTrust

ITWhisperer_0-1652286765400.png

 

Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

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