Dashboards & Visualizations

How to find the average duration trend of top 5 api above 5 seconds?

limalbert
Path Finder

How can I find the avg duration trend (timechart) of top 5 (most used) api above 5 seconds. If api has the same total calls, pick the highest duration.

This is what I have so far.

 

 

<Search string>
| bin _time span=1m 
| eventstats count as total by api
| stats avg(kpi_value) as duration by _time api total
| where duration >5
| timechart eval(round(avg(duration),2)) as avg_duration by api where total in top5 limit=0

 

 

 

Labels (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Give this a try

<Search string>  
| bin _time span=1m 
| stats avg(kpi_value) as duration by _time api
| where duration >5
| timechart eval(round(avg(duration),2)) as avg_duration by api limit=5 useother=f

View solution in original post

0 Karma

somesoni2
Revered Legend

Give this a try

<Search string>  
| bin _time span=1m 
| stats avg(kpi_value) as duration by _time api
| where duration >5
| timechart eval(round(avg(duration),2)) as avg_duration by api limit=5 useother=f
0 Karma

limalbert
Path Finder

I had this originally, but I might have been overthinking this problem. Thanks!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...