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!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...