Splunk Search

Average time on only top results

jevenson
Path Finder

I'm trying to get the top 10 uri's from our IIS logs, and get the average time taken on each of those. I can't quite figure out how to do it. If I use the top command, when I pipe it to a chart I no longer have the time_taken field.

This search works, but it returns all uri's, and I just want the top 10. There's got to be a way to do this.

sourcetype=iis | fields time_taken, cs_uri_stem | chart avg(time_taken) by cs_uri_stem

Tags (1)
0 Karma
1 Solution

sowings
Splunk Employee
Splunk Employee

Start with a subsearch to find the top 10 URIs, then run a search to find average time:

[ search sourcetype=iis | fields cs_uri_stem | top limit=10 showperc=f showcount=f cs_uri_stem ]
sourcetype = iis | fields cs_uri_stem time_taken | chart avg(time_taken) by cs_uri_stem

View solution in original post

0 Karma

sowings
Splunk Employee
Splunk Employee

Start with a subsearch to find the top 10 URIs, then run a search to find average time:

[ search sourcetype=iis | fields cs_uri_stem | top limit=10 showperc=f showcount=f cs_uri_stem ]
sourcetype = iis | fields cs_uri_stem time_taken | chart avg(time_taken) by cs_uri_stem
0 Karma

jevenson
Path Finder

This is exactly what I needed. Thanks!

0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...