Splunk Search

stats count by field and show total

sarit_s
Communicator

Hello,

I want to calculate the count of total events, count of errors and show the total percent of the failures from total.

my query is : 

sourcetype=WalletExecuter Exception.Message="* BitGo *" 
|stats count as total count(eval(Level="Error")) as FAILRUES by Exception.CorrelationId
| eval Failure%=round((FAILRUES/total)*100, 2) 

but the results that returned are the percent of each CorrelationId
how can i show the total failure percent ?

thanks

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Is this what you mean?

sourcetype=WalletExecuter Exception.Message="* BitGo *" 
|stats count as total count(eval(Level="Error")) as FAILRUES by Exception.CorrelationId
| eventstats sum(total) as grandtotal
| eval Failure%=round((FAILRUES/grandtotal)*100, 2) 
0 Karma

sarit_s
Communicator

Hey,

No.. i need total of all the correlationId in one line

this is the results of the query you sent:

sarit_s_0-1641732182495.png

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Sorry, I don't understand what you results you are expecting. Do you mean addcoltotals?

0 Karma
Get Updates on the Splunk Community!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...