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!

New Dates, New City: Save the Date for .conf25!

Wake up, babe! New .conf25 dates AND location just dropped!! That's right, this year, .conf25 is taking place ...

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud  In today’s fast-paced digital ...

Observability protocols to know about

Observability protocols define the specifications or formats for collecting, encoding, transporting, and ...