Splunk Search

Exclude search on a specific time at a specific weekday (weekly maintenance window)

skyrider1
New Member

Hi

We have a search where we get the request time out of a webapplication. Of course those request times suffer during our weekly maintenance window. Now i tried to filter out those specific times by using the following filter:

|eval myHour=strftime(_time, "%H")
|eval myDay=strftime(_time, "%a")
|where NOT (( myHour >= 18 ) AND ( myHour <= 22 AND myDay=Thu))

The myDay on it's own doesn't work..

Somewho it's not working that way, so i appreciate any help...

Thanks

Tags (1)
0 Karma
1 Solution

kristian_kolb
Ultra Champion

Could you not use the date_* fields for this? Those should work unless you have servers in different time zones.

sourcetype=your_web_app NOT (date_wday = thursday date_hour >=18 date_hour <= 22 ) 

/Kristian

View solution in original post

kristian_kolb
Ultra Champion

Could you not use the date_* fields for this? Those should work unless you have servers in different time zones.

sourcetype=your_web_app NOT (date_wday = thursday date_hour >=18 date_hour <= 22 ) 

/Kristian

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

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