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.
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...