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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...