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!

How to Monitor Google Kubernetes Engine (GKE)

We’ve looked at how to integrate Kubernetes environments with Splunk Observability Cloud, but what about ...

Index This | How can you make 45 using only 4?

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

Splunk Education Goes to Washington | Splunk GovSummit 2024

If you’re in the Washington, D.C. area, this is your opportunity to take your career and Splunk skills to the ...