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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...