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
Revered Legend

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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...