Splunk Search

How do I search for Day/Time with least amount of events?

bamalone
New Member

I want to find out which day of the week and time range has the least amount of traffic during the past 30 days during working hours in 3 hour groups.

The search results should return the day and time range.

Example: Monday 9am - 12pm.

Bonus points if you can help me return the top 3 results. Example: Monday 9am - 12pm, Monday 3pm - 6pm and Friday 3pm - 6pm.

Tags (1)
0 Karma

niketn
Legend

@bamalone, try the following search for Last 30 days

| tstats count latest(_time) as Max WHERE index=_internal BY _time span=3h
| fieldformat Max=strftime(Max,"%m/%a %H:%M")
| eval Time= strftime(_time,"%m/%a")." ".strftime(_time,"%H %p")." - ".strftime(Max,"%H %p") 
| table Time count
| sort count
| head 3

PS: Replace with your index as above one is run anywhere search example with Splunk's _internal index.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...