Splunk Search

Trick to manage business hours / weekdays at search time

splunkreal
Motivator

Hello guys,

this isn't a question just a trick 🙂

Add this to your query :

| appendcols 
    [| makeresults 
    |  eval curWDay=strftime(_time,"%A")
|  eval curHour=tonumber(strftime(_time,"%H"))]
| search ((curHour>08 AND curHour<13) OR (curHour>13 AND curHour<20))
| search (curWDay = Monday OR curWDay = Tuesday OR curWDay = Wednesday OR curWDay = Thursday OR curWDay = Friday)
* If this helps, please upvote or accept solution if it solved *
0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...