Splunk Search

How to remove third Thursday from Splunk results

blisowski
New Member

We would like to remove our monthly patching window from our error report that we receive from Splunk on some of our servers we report on. For example, we would like to be able to remove the data/error spike we get on the 3rd Thursday between the hours of 2pm-3pm during patching, and have this carry over into the next year, always the 3rd Thursday from 2-3pm removed from our data. In short, this would need to be a dynamic search, not specifically calling out dates.

We can't simply remove these errors themselves from the data, as every other day of the year we do want to see that information. Thoughts?

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Assuming your monthly report run on 2nd of every month, which runs on previous month, try like this

your base search for selecting last months data
| where NOT (_time>=relative_time(now(),"-1mon@mon+3w@w4+14h")  AND _time<relative_time(now(),"-1mon@mon+3w@w4+15h")  )

See this runanywhere sample on how those relative time calculates the third Thursday by month

| gentimes start=-12 | streamstats count | table count | eval month=strptime(count."/01/2019","%m/%d/%Y") | table month | eval thirdthu_start=relative_time(month,"@mon+3w@w4+14h")  | eval thirdthu_end=relative_time(month,"@mon+3w@w4+15h")| convert ctime(*) timeformat="%a %F %T"
0 Karma

efavreau
Motivator

Take caution with this approach. As soon as you slip a date, this query becomes unreliable. However, to answer your question:
Append this before your first | in your search:
NOT (date_wday=thursday AND date_hour=14 AND date_mday>14 AND date_mday<22)
This looks for a Thursday between the 14 and 22, which would always be the third Thursday, and selects events beginning 2pm. This covers from 2:00 pm - 2:59:59 pm. The NOT in front, says don't include these events.

###

If this reply helps you, an upvote would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...