Splunk Search

STATS function

shangshin
Builder

Hi, Is there a way to find out the max response time during a 30-minute bucket and its associated url from the web server log?

I tried to use the search string below but seems to be not working. Please advise. Thanks!

sourcetype="access_log" | bucket _time span=30m | STATS max(TotalResponseTime), url by _time

Tags (1)
0 Karma
1 Solution

reed_kelly
Contributor

Use eventstats to preserve the url and then grab only those urls where the response time equals the max. If there are multiple urls with the same TotalResponseTime, then you could still get multiple urls for the same time range, but that would seem unlikely.

sourcetype="access_log" | bucket _time span=30m | eventstats max(TotalResponseTime) as maxtim by _time | where TotalResponseTime=maxtim |table _time,TotalResponseTime,url

View solution in original post

0 Karma

reed_kelly
Contributor

Use eventstats to preserve the url and then grab only those urls where the response time equals the max. If there are multiple urls with the same TotalResponseTime, then you could still get multiple urls for the same time range, but that would seem unlikely.

sourcetype="access_log" | bucket _time span=30m | eventstats max(TotalResponseTime) as maxtim by _time | where TotalResponseTime=maxtim |table _time,TotalResponseTime,url

0 Karma

DaveSavage
Builder

Does .... STATS max(TotalResponseTime) by _time url work for you?
I think its trying to use 'url' as an argument?
Br
Dave S

0 Karma

shangshin
Builder

Unfortunately, this is not something I need. I only care about the url with max response time.
I have various types of urls in the web access log. If I add the url at the end of the search string, I will have too many results.

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