<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to disable splunk alert for a specific time frame? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-disable-splunk-alert-for-a-specific-time-frame/m-p/677978#M231852</link>
    <description>&lt;P&gt;You have two options:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Duplicate the alert and use a different cron expression for the different days/time periods&lt;/LI&gt;&lt;LI&gt;Use now() function to determine when the search is running and modify the results so that the alert isn't triggered.&lt;/LI&gt;&lt;/OL&gt;</description>
    <pubDate>Mon, 19 Feb 2024 11:50:16 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-02-19T11:50:16Z</dc:date>
    <item>
      <title>How to disable splunk alert for a specific time frame?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-disable-splunk-alert-for-a-specific-time-frame/m-p/677977#M231851</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;We want an alert to run every day (Monday-Sunday) on a 30 minutes interval with one exception. The exception is it should not run specifically on Wednesday and Friday from 5AM to 8AM. However it should run on other hours on Wednesday and Friday as well &amp;nbsp;(apart from 5AM to 8AM)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;One cron is not able to achieve that. Hence want to change in the alert logic.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 11:44:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-disable-splunk-alert-for-a-specific-time-frame/m-p/677977#M231851</guid>
      <dc:creator>rzv424</dc:creator>
      <dc:date>2024-02-19T11:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to disable splunk alert for a specific time frame?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-disable-splunk-alert-for-a-specific-time-frame/m-p/677978#M231852</link>
      <description>&lt;P&gt;You have two options:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Duplicate the alert and use a different cron expression for the different days/time periods&lt;/LI&gt;&lt;LI&gt;Use now() function to determine when the search is running and modify the results so that the alert isn't triggered.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Mon, 19 Feb 2024 11:50:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-disable-splunk-alert-for-a-specific-time-frame/m-p/677978#M231852</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-02-19T11:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to disable splunk alert for a specific time frame?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-disable-splunk-alert-for-a-specific-time-frame/m-p/677979#M231853</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/265054"&gt;@rzv424&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;Solution1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You can create two alerts with the same logic with different CRONs.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;1st alert CRON will run every day except on Wed and Fri. Cron is: */30 * * * 0,1,2,4,6&lt;/LI&gt;&lt;LI&gt;Second alert CRON will run every 30 minutes on Wednesday and Friday and will stop from 5AM to 8AM. Cron is: */30 0-5,8-23 * * 3,5&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Solution2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You can create one alert with a CRON to run every day of the week at 30 minutes interval, Cron is */30 * * * *&lt;/P&gt;&lt;P&gt;And you can add the filtering at the logic of query itself:&lt;BR /&gt;Use an EVAL command to output the current day and hour after your logic ends. and then filter or don't show your outputs as per your exception requirement&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;SPAN class=""&gt;......| eval now_day=strftime(now(), "%a"), now_hour=strftime(now(), "%H")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;| search NOT ((now_day="Wed" AND (now_hour="5" OR now_hour="6" OR now_hour="7" OR now_hour="8")) OR (now_day="Fri" AND (now_hour="5" OR now_hour="6" OR now_hour="7" OR now_hour="8")))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 12:06:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-disable-splunk-alert-for-a-specific-time-frame/m-p/677979#M231853</guid>
      <dc:creator>subham29</dc:creator>
      <dc:date>2024-02-19T12:06:40Z</dc:date>
    </item>
  </channel>
</rss>

