<?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 Alert with time exclusion in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481493#M8523</link>
    <description>&lt;P&gt;I have setup an alert to run a search every 10 minutes which looks for a specific Event Code and a Message string. I want this to return results except for times between 12:30am and 1:30am. How can I do this? I tried the following below but it is not working:&lt;/P&gt;

&lt;P&gt;index=*-windows-logs EventCode=7036 Message="Service Entered A Running State"  | sort - _time  | eval myHour=strftime(_time, "%H") | eval myMinute=strftime(_time, "%M") | where NOT ( (myHour &amp;gt; 00 AND myMinute &amp;gt;30 ) AND (myHour &amp;lt;01  AND myMinute &amp;lt; 30) ) | table _time, ComputerName, Message&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 03:37:15 GMT</pubDate>
    <dc:creator>johann2017</dc:creator>
    <dc:date>2020-09-30T03:37:15Z</dc:date>
    <item>
      <title>Alert with time exclusion</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481493#M8523</link>
      <description>&lt;P&gt;I have setup an alert to run a search every 10 minutes which looks for a specific Event Code and a Message string. I want this to return results except for times between 12:30am and 1:30am. How can I do this? I tried the following below but it is not working:&lt;/P&gt;

&lt;P&gt;index=*-windows-logs EventCode=7036 Message="Service Entered A Running State"  | sort - _time  | eval myHour=strftime(_time, "%H") | eval myMinute=strftime(_time, "%M") | where NOT ( (myHour &amp;gt; 00 AND myMinute &amp;gt;30 ) AND (myHour &amp;lt;01  AND myMinute &amp;lt; 30) ) | table _time, ComputerName, Message&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:37:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481493#M8523</guid>
      <dc:creator>johann2017</dc:creator>
      <dc:date>2020-09-30T03:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Alert with time exclusion</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481494#M8524</link>
      <description>&lt;P&gt;UPDATED:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....
| where NOT ( (myHour="00" AND myMinute &amp;gt;30 ) OR (myHour="01" AND myMinute &amp;lt; 30))
| table _time, ComputerName, Message
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....
| where NOT ( (myHour=0 AND myMinute &amp;gt;30 ) OR (myHour=1 AND myMinute &amp;lt; 30))
| table _time, ComputerName, Message
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hi,   @johann2017&lt;BR /&gt;
how about this?&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;myHour&lt;/EM&gt; can use by both string and number.&lt;BR /&gt;
However, numbers must be treated as described above.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 21:05:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481494#M8524</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-09T21:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Alert with time exclusion</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481495#M8525</link>
      <description>&lt;P&gt;That seems to have done it! Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 21:41:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481495#M8525</guid>
      <dc:creator>johann2017</dc:creator>
      <dc:date>2020-01-09T21:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Alert with time exclusion</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481496#M8526</link>
      <description>&lt;P&gt;One more question, how can I exclude a larger time range? It seems that this works great for excluding within the same hour, but for instance if try to exclude between 00 and 04 it does not work properly. Example below:&lt;/P&gt;

&lt;P&gt;index=*-windows-logs EventCode=7036 Message="Service Entered A Running State" | sort - _time | eval myHour=strftime(_time, "%H") | eval myMinute=strftime(_time, "%M") | where NOT ( (myHour &amp;gt; 00 AND myMinute &amp;gt;00 ) AND (myHour &amp;lt;04 AND myMinute &amp;lt; 00) ) | table _time, ComputerName, Message&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:37:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481496#M8526</guid>
      <dc:creator>johann2017</dc:creator>
      <dc:date>2020-09-30T03:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Alert with time exclusion</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481497#M8527</link>
      <description>&lt;P&gt;Also, how can I tell the search to only run within a specific timeframe, lets say between only 8am - 5pm?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 22:13:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481497#M8527</guid>
      <dc:creator>johann2017</dc:creator>
      <dc:date>2020-01-09T22:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Alert with time exclusion</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481498#M8528</link>
      <description>&lt;P&gt;you can use index=your_index earliest=01/09/2020:08:00:00 latest=01/09/2020:17:00:00  Remaining search&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 22:48:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481498#M8528</guid>
      <dc:creator>snallam123</dc:creator>
      <dc:date>2020-01-09T22:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Alert with time exclusion</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481499#M8529</link>
      <description>&lt;P&gt;Thanks @snallam123  !!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 20:49:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-with-time-exclusion/m-p/481499#M8529</guid>
      <dc:creator>johann2017</dc:creator>
      <dc:date>2020-01-23T20:49:23Z</dc:date>
    </item>
  </channel>
</rss>

