Splunk Search

Find peak time and the number of requests

ricm
New Member

Hi,
I want to find the peak time in a day and number of requests on that peak time.
I trying to use the following but with no luck regarding the peak time.

index=servers sourcetype=web
| eval time_formatted=strftime(time,"%H:%M:%S")
| bucket time span=1s
| stats count by time
| stats max(count) as max_requests_per_second
| table max_requests_per_second time_formatted

Any idea on how to get the peak time correct?
thanks

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

HI @ricm ,

Can you please try this?

index=servers sourcetype=web | timechart count as requests_per_second span=1s | eventstats max(requests_per_second) as max_requests_per_second | where requests_per_second=max_requests_per_second | eval "Peak Time"=strftime(_time, "%d/%m/%Y %H:%M:%S %p")  | table "Peak Time" max_requests_per_second

Thanks

0 Karma

Sukisen1981
Champion

try this -
instead of
stats count by time|
stats max(count) as max_requests_per_second
try to get this result in one line by using eventsats
eventstats max(count) as max_requests_per_second by time

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...