<?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: Sending conditional alerts based on previous search result in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Sending-conditional-alerts-based-on-previous-search-result/m-p/308988#M2698</link>
    <description>&lt;P&gt;You can try the alert throttling option - &lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.splunk.com/blog/2010/06/01/alert-throttling.html"&gt;https://www.splunk.com/blog/2010/06/01/alert-throttling.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Alert/ThrottleAlerts"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Alert/ThrottleAlerts&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Oct 2017 05:27:16 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2017-10-17T05:27:16Z</dc:date>
    <item>
      <title>Sending conditional alerts based on previous search result</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Sending-conditional-alerts-based-on-previous-search-result/m-p/308987#M2697</link>
      <description>&lt;P&gt;Following is the json log format being stored in Splunk.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{   data:[
     {
       "endpoint":"ep_1",
       "service":"service_1",
       "http_status_code":"500"
     },
     {
       "endpoint":"ep_2",
       "service":"service_1",
       "http_status_code":"500"
     },
     {
       "endpoint":"ep_3",
       "service":"service_2",
       "http_status_code":"503"
     }   ] }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Currently, an alert is setup to check once every 5 mins with the following search query and send an email if results&amp;gt;0.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=something "data{}.http_status_code"= 5*| eval endpoint='data{}.endpoint' | Stats Count("data{}.http_status_code") as Count by endpoint | where Error_Count &amp;gt; 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The generated result is : &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3669i356570BBA2728E13/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Now, the ask is, once an alert is generated (which contains a particular endpoin, say ep_1), in the next run, if the search result contains the same endpoint, it should NOT send an email for another hour. &lt;/P&gt;

&lt;P&gt;So in this case, when the search query runs after 5 mins and contains ep_1 in the result, it should not send an email. So effectively, I need a condition for this endpoint's occurrence in the previously executed search result.&lt;/P&gt;

&lt;P&gt;Is there a way this can be accomplished? Please help.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 05:19:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Sending-conditional-alerts-based-on-previous-search-result/m-p/308987#M2697</guid>
      <dc:creator>technie101</dc:creator>
      <dc:date>2017-10-17T05:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sending conditional alerts based on previous search result</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Sending-conditional-alerts-based-on-previous-search-result/m-p/308988#M2698</link>
      <description>&lt;P&gt;You can try the alert throttling option - &lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.splunk.com/blog/2010/06/01/alert-throttling.html"&gt;https://www.splunk.com/blog/2010/06/01/alert-throttling.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Alert/ThrottleAlerts"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Alert/ThrottleAlerts&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 05:27:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Sending-conditional-alerts-based-on-previous-search-result/m-p/308988#M2698</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2017-10-17T05:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sending conditional alerts based on previous search result</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Sending-conditional-alerts-based-on-previous-search-result/m-p/308989#M2699</link>
      <description>&lt;P&gt;The only way to accomplish this that I can think of is to save the results of your alerting search in a lookup file (using outputlookup) or the KVStore and use the contents of that lookup file/KVStore collection to filter out the unwanted endpoints (ie. all the ones in the lookup file from the last run). You'll have to include last alert timestamp per endpoint as a column in your lookup and make timestamp comparison part of your filter criteria.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 06:09:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Sending-conditional-alerts-based-on-previous-search-result/m-p/308989#M2699</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-10-17T06:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sending conditional alerts based on previous search result</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Sending-conditional-alerts-based-on-previous-search-result/m-p/308990#M2700</link>
      <description>&lt;P&gt;Thanks. Trying this approach with a KVStore now. &lt;/P&gt;

&lt;P&gt;For the above usecase, how do we compare the endpoint from the search results with the endpoint from the KVStore?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 09:15:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Sending-conditional-alerts-based-on-previous-search-result/m-p/308990#M2700</guid>
      <dc:creator>technie101</dc:creator>
      <dc:date>2017-10-18T09:15:43Z</dc:date>
    </item>
  </channel>
</rss>

