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!

Quantify Your Splunk Investment Impact: Introducing Savings Metrics to Value Insights

Building on the foundation established in our initial Value Insights releases, we are introducing the Savings ...

Event Series: Telemetry Pipeline Management

Balancing Scale and Spend: Gaining Control Over High-Volume Metrics in Splunk Observability Cloud As ...

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...