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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...