Splunk Search

How to calculate percentage by another field?

Hung_Nguyen
Path Finder

I would like to create a dashboard to show the percentage of each of my service meeting a certain performance requirement.  Each of the request access log entry would have field serviceName, txTime, and I would like to generate a table that show the percentage of requests meeting my SLA requirement of say 1000ms.  

The desired output would look something like

ServiceName                     Percentage
Service1                                98.9%
Service2                                99%

thank you

Labels (1)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

How about 

| eval SLA = if(txTime < 1000, 1, 0)
| stats count sum(SLA) as meetSLA by serviceName
| eval Percentage = 100 * meetSLA / count
| fields - count, meetSLA
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...