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!

Splunk Search APIを使えば調査過程が残せます

   このゲストブログは、JCOM株式会社の情報セキュリティ本部・専任部長である渡辺慎太郎氏によって執筆されました。 Note: This article is published in both Japanese ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...