<?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 create a Splunk alert and schedule it to bypass a particular time range by using a cron schedule? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-alert-and-schedule-it-to-bypass-a/m-p/162209#M2660</link>
    <description>&lt;P&gt;Use Cron.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1 1-20 * * * 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will work for all hours from 1AM - 8PM. I typically don't start things at the top of the hour to avoid resource contention with other hourly crons that may be installed on the system.&lt;/P&gt;

&lt;P&gt;Edit: I double checked the syntax and had forgotten that a range can work as well.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Aug 2015 16:36:26 GMT</pubDate>
    <dc:creator>alacercogitatus</dc:creator>
    <dc:date>2015-08-06T16:36:26Z</dc:date>
    <item>
      <title>How to create a Splunk alert and schedule it to bypass a particular time range by using a cron schedule?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-alert-and-schedule-it-to-bypass-a/m-p/162208#M2659</link>
      <description>&lt;P&gt;I want to create a splunk alert and schedule it in such a way that it should bypass the particular timeframe (e.g it should not run between 9 PM to 12 AM).&lt;/P&gt;

&lt;P&gt;How can do it?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2015 07:21:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-alert-and-schedule-it-to-bypass-a/m-p/162208#M2659</guid>
      <dc:creator>tkmads1</dc:creator>
      <dc:date>2015-08-06T07:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Splunk alert and schedule it to bypass a particular time range by using a cron schedule?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-alert-and-schedule-it-to-bypass-a/m-p/162209#M2660</link>
      <description>&lt;P&gt;Use Cron.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1 1-20 * * * 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will work for all hours from 1AM - 8PM. I typically don't start things at the top of the hour to avoid resource contention with other hourly crons that may be installed on the system.&lt;/P&gt;

&lt;P&gt;Edit: I double checked the syntax and had forgotten that a range can work as well.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2015 16:36:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-alert-and-schedule-it-to-bypass-a/m-p/162209#M2660</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2015-08-06T16:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Splunk alert and schedule it to bypass a particular time range by using a cron schedule?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-alert-and-schedule-it-to-bypass-a/m-p/162210#M2661</link>
      <description>&lt;P&gt;You can short-circuit the job during the blackout period by using &lt;CODE&gt;addinfo&lt;/CODE&gt; and &lt;CODE&gt;map&lt;/CODE&gt; for the blackout period that it is not supposed to run like this (extra steps for clarity):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| noop | stats count AS myHourMin | addinfo | eval myHourMin=tonumber(strftime(now(), "%H%M")) | eval blackout= if((myHourMin&amp;gt;2100),"YES","NO") | eval earliestMaybe=if((blackout=="NO"), info_min_time, now()) | map search="search earliest=$earliestMaybe$ latest=$info_max_time$ YOUR SEARCH HERE"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For the time range that it is not supposed to run, the search will generate an error.&lt;/P&gt;

&lt;P&gt;Here are other similar questions with answers that should work for you (this answer is derived from the first one):&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answering/260370/view.html"&gt;http://answers.splunk.com/answering/260370/view.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/24824/can-i-set-a-blackout-period-for-a-scheduled-search-during-which-it-should-not-generate-alerts.html"&gt;http://answers.splunk.com/answers/24824/can-i-set-a-blackout-period-for-a-scheduled-search-during-which-it-should-not-generate-alerts.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2015 16:49:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-alert-and-schedule-it-to-bypass-a/m-p/162210#M2661</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-06T16:49:16Z</dc:date>
    </item>
  </channel>
</rss>

