Splunk Search

Top avg latencies by IP

tmarlette
Motivator

I am attempting to get the top offenders of average latency, by their client IP, but limited to the top 50 results, sorted by their latency. This is the search that I have, but I can't figure our why it doesn't return any results. If I remove the 'top' command from the below query, it returns results, but it returns all of them, which isn't as helpful.

sourcetype=www NOT hck=* | stats avg(timetaken) by _time,clientip | top timetaken

any suggestions would be great! Thank you!

Tags (2)
0 Karma
1 Solution

kristian_kolb
Ultra Champion

A few things;

top count occurrences, not high/low values.

stats removes all the other fields, so after that you only have _time, clientip and avg(timetaken).

Suggest the following;

sourcetype=www NOT hck=* | stats avg(timetaken) as TT by _time,clientip | stats max(TT) as XXXX by clientip | sort - XXXX | head 50 

/K

View solution in original post

kristian_kolb
Ultra Champion

A few things;

top count occurrences, not high/low values.

stats removes all the other fields, so after that you only have _time, clientip and avg(timetaken).

Suggest the following;

sourcetype=www NOT hck=* | stats avg(timetaken) as TT by _time,clientip | stats max(TT) as XXXX by clientip | sort - XXXX | head 50 

/K

Get Updates on the Splunk Community!

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...