<?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 Splunk Subsequent Alert in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Splunk-Subsequent-Alert/m-p/380508#M6705</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am running an alert for every 15 mins and looking for a logic to stop subsequent splunk alerts if a field value remains the same during the next run of the alert. The next alert should trigger only if the field value changes&lt;/P&gt;

&lt;P&gt;Appreciate if someone can help with the logic.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jun 2018 20:44:15 GMT</pubDate>
    <dc:creator>chintu_jain</dc:creator>
    <dc:date>2018-06-11T20:44:15Z</dc:date>
    <item>
      <title>Splunk Subsequent Alert</title>
      <link>https://community.splunk.com/t5/Alerting/Splunk-Subsequent-Alert/m-p/380508#M6705</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am running an alert for every 15 mins and looking for a logic to stop subsequent splunk alerts if a field value remains the same during the next run of the alert. The next alert should trigger only if the field value changes&lt;/P&gt;

&lt;P&gt;Appreciate if someone can help with the logic.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 20:44:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Splunk-Subsequent-Alert/m-p/380508#M6705</guid>
      <dc:creator>chintu_jain</dc:creator>
      <dc:date>2018-06-11T20:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Subsequent Alert</title>
      <link>https://community.splunk.com/t5/Alerting/Splunk-Subsequent-Alert/m-p/380509#M6706</link>
      <description>&lt;P&gt;You can do several things. If you only need to compare two time periods ad see if there is a difference, you can use &lt;CODE&gt;multisearch&lt;/CODE&gt;. Something like this might work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch 
    [ search &amp;lt;your-search-to-get-data&amp;gt; earliest=-30m@m latest=-15m@m
    | eval type=first] 
    [ search &amp;lt;your-search-to-get-data&amp;gt; earliest=-15m@m latest=-0m@m
    | eval type=next]
| stats values(&amp;lt;field-you-want-to-compare&amp;gt;) as val
| eval diff=if(mvindex(val,0)!=mvindex(val,1),1,0)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This can take any time periods that you want, for example, you can set it to the same time on the previous day to be compared with the value today, so it is general in nature. Just set the &lt;CODE&gt;earliest&lt;/CODE&gt; and &lt;CODE&gt;latest&lt;/CODE&gt; times appropriately. The &lt;CODE&gt;stats&lt;/CODE&gt; command makes a multivalue field that can then be used with the eval. The &lt;CODE&gt;mvindex&lt;/CODE&gt; function let's you grab the two values that you get and set the difference in the field &lt;CODE&gt;diff&lt;/CODE&gt;. If the value of &lt;CODE&gt;diff&lt;/CODE&gt; is 1, then they are different, and if 0, then the same. This is a very generalized way to handle doing this. There are many ways to make it more efficient or effective.&lt;/P&gt;

&lt;P&gt;You don't really need the &lt;CODE&gt;eval type="first"&lt;/CODE&gt; or &lt;CODE&gt;eval type="last"&lt;/CODE&gt;. It just makes it possible to see the values separately. Don't worry about getting hung up on what it does, because in this case it doesn't really do anything, but it &lt;STRONG&gt;could&lt;/STRONG&gt; be useful in some circumstances.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 22:37:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Splunk-Subsequent-Alert/m-p/380509#M6706</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2018-06-11T22:37:52Z</dc:date>
    </item>
  </channel>
</rss>

