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!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...