All Apps and Add-ons

how to calculate percentage in timechart by?

karthi2809
Builder

index=xxx|transaction transid startswith="Request" endswith="Response" Keeporphans=t |timechart avg((count(eval(Result="FAILURE"))/count(eval(OperationName)))) count as TotalCount count(eval(Result="SUCCESS")) as SuccessCnt count(eval(Result="FAILURE")) as FatalCnt by OperationName |eval FailurePercentage= (FatalCnt*100/TotalCount)

Tags (1)
0 Karma

cmerriman
Super Champion

Try this:

index=xxx|transaction transid startswith="Request" endswith="Response" Keeporphans=t |timechart avg((count(eval(Result="FAILURE"))/count(eval(OperationName)))) count as TotalCount count(eval(Result="SUCCESS")) as SuccessCnt count(eval(Result="FAILURE")) as FatalCnt by OperationName|foreach FatalCnt* [eval FailurePercentage<<MATCHSTR>>= ('<<FIELD>>'/'TotalCount<<MATCHSTR>>')*100]

doc on foreach:
http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Foreach

chimell
Motivator

Hi

Try this search code :

index=xxx|transaction transid startswith="Request" endswith="Response" Keeporphans=t |timechart avg((count(eval(Result="FAILURE"))/count(eval(OperationName))))  as TotalCount , count(eval(Result="SUCCESS")) as SuccessCnt , count(eval(Result="FAILURE")) as FatalCnt by OperationName |eval FailurePercentage= (FatalCnt/TotalCount)*100
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...