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!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...