Splunk Search

How to specify the time frame in a search?

troy44112
Explorer

Hello,

How would I specify the time frame in a search to provide me the events between 7am - 5pm weekdays and all results for weekends within the same search

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @troy44112,

in addition to the solution of @richgalloway, that completely answers to your question, you could also manage the holidays following the instruction that you can find in this my old answer: https://community.splunk.com/t5/Splunk-Search/Bank-holiday-exclusion-from-search-query/m-p/491071

Ciao.

Giuseppe

richgalloway
SplunkTrust
SplunkTrust

Here's one way if your data includes the date_* fields (usually true).

index=foo <<more search terms>>
| where ((date_wday="saturday" OR date_wday="sunday") OR (date_hour>=7 date_hour<17))
---
If this reply helps you, Karma would be appreciated.
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!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...