Splunk Search

help for retrieving events during the week only

jip31
Motivator

hi

I use this search in order to retrieve events between 9h and 17h

Now I also want to catch the events only between the monday and the friday

How to do this please?

 

 

 

`CPU` 
| bin _time span=5h
| eval slottime = strftime(_time, "%H%M") 
| where (slottime >= 900 AND slottime <= 1700) 

 

 

 

 

Labels (1)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

The w needs to be lower case

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

strftime with %w then where value between 1 and 5 inclusive

0 Karma

jip31
Motivator

like this??

 

`CPU` 
| bin _time span=5h 
| eval slottime = strftime(_time, "%H%M") 
| eval week =strftime(_time, "%W") 
| where (slottime >= 900 AND slottime <= 1700) AND (week >=1 AND week <=5)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The w needs to be lower case

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...