<?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: Splunk alert to be triggered based on time of the day in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-to-be-triggered-based-on-time-of-the-day/m-p/438866#M124889</link>
    <description>&lt;P&gt;I've been told not to use date_wday with stats due to some typical fringe cases where it's inaccurate.  It's a calculated field after all.&lt;/P&gt;

&lt;P&gt;It would be better (again I'm told by the smarter folks) to eval the hour like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval hour=strftime(_time,"%H")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then use the conditional logic on it.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2019 13:41:17 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2019-06-24T13:41:17Z</dc:date>
    <item>
      <title>Splunk alert to be triggered based on time of the day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-to-be-triggered-based-on-time-of-the-day/m-p/438864#M124887</link>
      <description>&lt;P&gt;My search condition is checking for results less than 10 every 45 minutes. The problem is we don't have that much traffic in the night to make it up to 10 searches. Is there an option to alert based on time of the day,  for example trigger an alert  if the number of searches is less than 10 between 09:00 to 18:00 and in the off hours trigger an alert if the number of searches is less than 3. &lt;/P&gt;

&lt;P&gt;I can write a separate splunk alert to cover off hours but wanted to check if there is an option to do this in the one alert.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 09:52:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-to-be-triggered-based-on-time-of-the-day/m-p/438864#M124887</guid>
      <dc:creator>anweshar</dc:creator>
      <dc:date>2019-06-24T09:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk alert to be triggered based on time of the day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-to-be-triggered-based-on-time-of-the-day/m-p/438865#M124888</link>
      <description>&lt;P&gt;you can write an &lt;CODE&gt;eval&lt;/CODE&gt; statement for example and alert on its results, example:&lt;BR /&gt;
&lt;CODE&gt;... your search ... | eval bus_hours = if(date_hour&amp;gt;=9 AND date_hour&amp;lt;=18,"yes","no") ... &lt;BR /&gt;
 | eval alert = if(your_count &amp;lt; 10 AND bus_hours = "yes","alert","not_alert) ...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and now count the new &lt;CODE&gt;alert&lt;/CODE&gt; field or configure your alert however you want&lt;/P&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 12:20:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-to-be-triggered-based-on-time-of-the-day/m-p/438865#M124888</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-06-24T12:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk alert to be triggered based on time of the day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-to-be-triggered-based-on-time-of-the-day/m-p/438866#M124889</link>
      <description>&lt;P&gt;I've been told not to use date_wday with stats due to some typical fringe cases where it's inaccurate.  It's a calculated field after all.&lt;/P&gt;

&lt;P&gt;It would be better (again I'm told by the smarter folks) to eval the hour like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval hour=strftime(_time,"%H")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then use the conditional logic on it.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 13:41:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-to-be-triggered-based-on-time-of-the-day/m-p/438866#M124889</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-06-24T13:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk alert to be triggered based on time of the day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-to-be-triggered-based-on-time-of-the-day/m-p/438867#M124890</link>
      <description>&lt;P&gt;The &lt;CODE&gt;date_*&lt;/CODE&gt; fields can be used IF they are there (there are not in every sourcetype/event); just be aware that they are interpreted to be in the timezome of the local event, not normalized to GMT/Zulu.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 19:56:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-alert-to-be-triggered-based-on-time-of-the-day/m-p/438867#M124890</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-06-24T19:56:54Z</dc:date>
    </item>
  </channel>
</rss>

