Splunk Search

Displaying peak count/hr of each uri

harpan
New Member

The problem statement consists of 2 parts

  1. capture all the URIs hit in a specific month with specific conditions as below.

sourcetype=iis host=pdestm* cs_uri_stem="/MaterialBalance/" | rex field=cs_uri_stem mode=sed "s/\d+/#/g" | eval SecondsTaken=time_taken/1000| stats count, avg(SecondsTaken) by cs_uri_stem, cs_method | eventstats sum(count) as totalcount | eval percent= (count/totalcount)*100 | where percent>2 OR max(SecondsTaken)>5 | table cs_uri_stem, cs_method, count, percent, avg(SecondsTaken)

The above query returns

cs_uri_stem | cs_method | count | percent | avg(SecondsTaken)
/uri/Details/# | GET | 3575 | 48.487 | 1.7216218181818186
/uri/xxx/# | GET | 12017| 36.688 |1.8851170009153773

This part has been successfully captured.

  1. Find the max count/ hr of each URI. The expected result is as below

cs_uri_stem | hour in which peak count has been observed | count in peak hour
/uri/Details/#| 2019-04-28 00:00 | 156
/uri/xx/#| 2019-04-26 04:00 | 651

Looking for a solution for part 2.

Tags (1)
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...