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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...