Splunk Search

Facing issue with my Serach

Amit79
Loves-to-Learn Everything

Hello All,

Below is my alert script, and I dont want to have any alerts during night 11:50 to 00:25 midnight, however I am getting them and its triggering alert to the support team. this is the daily restart window for interfaces and no need of alerts during this time.

index=XXX sourcetype=XXX  punct="--_::.,_=\"\""
| rex field=_raw "\d*-\d*-\d*\s(?<hour>\d*:\d*):\d*\S\d*\S"
| search hour!=23:50
| search hour!=00:15
| table _time SITE

Appreciate help on this.

 

Below is the sample event

2024-03-20 06:32:08.046, SITE="UU3"
Tags (1)
0 Karma

sjringo
Contributor

Find out what the current time is then compare to you window times:

| eval timeNow = strftime(now(), "%H%M")

| where (timeNow < 2350 AND timeNow > 0015)   ```Outside of main. window```

 

0 Karma

Amit79
Loves-to-Learn Everything

correction : no need of alerts during 23:50 to 00:15

0 Karma
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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...