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!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...