<?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 set up Splunk alert for changing logs? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345938#M6117</link>
    <description>&lt;P&gt;Hi Javip,&lt;BR /&gt;
i have modified query for this requirement&lt;/P&gt;

&lt;P&gt;index=ABC host=ABC sourcetype=ABC  "Success" OR "Failure"&lt;BR /&gt;
 | head 1 &lt;BR /&gt;
 | eval event_time=_time, time_now=Now() &lt;BR /&gt;
 | eval diff=time_now-event_time &lt;BR /&gt;
 | where diff&amp;gt;=300 AND like(_raw, "%Failure%")&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 19:08:56 GMT</pubDate>
    <dc:creator>logloganathan</dc:creator>
    <dc:date>2020-09-29T19:08:56Z</dc:date>
    <item>
      <title>How to set up Splunk alert for changing logs?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345928#M6107</link>
      <description>&lt;P&gt;I want to setup alert for changing logs.&lt;BR /&gt;
The service name changed to success from failure then it writes to a log file and vice-versa but we don't know when its value change occurs. It may occur in 5 minutes or 1 hour or 1 day and the log file contains information like:&lt;/P&gt;

&lt;P&gt;success&lt;BR /&gt;
failure&lt;BR /&gt;
success&lt;BR /&gt;
failure&lt;/P&gt;

&lt;P&gt;I want to alert if only failure happens for a particular time, say 5 minutes (no success occur for 5 minutes)&lt;BR /&gt;
if success occur after failure then it wont alert&lt;BR /&gt;
Please help me on this issue&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 15:20:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345928#M6107</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-04-16T15:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up Splunk alert for changing logs?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345929#M6108</link>
      <description>&lt;P&gt;You need to schedule the matching search for every 5 minutes.&lt;/P&gt;

&lt;P&gt;Splunk search would be like this base search |stats count by respecfield |where count &amp;gt;0 and will set the trigger ocndition to send an email if results are greater than 0 .&lt;/P&gt;

&lt;P&gt;Splunk runs the search for every 5 mins as scheduled but only notifies you when the result count is greater than condition given .&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 12:48:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345929#M6108</guid>
      <dc:creator>ssadanala1</dc:creator>
      <dc:date>2018-04-17T12:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up Splunk alert for changing logs?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345930#M6109</link>
      <description>&lt;P&gt;it wont help for my requirement.&lt;BR /&gt;
Thanks for your help&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 12:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345930#M6109</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-04-17T12:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up Splunk alert for changing logs?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345931#M6110</link>
      <description>&lt;P&gt;Could anyone please help me in this issue?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 09:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345931#M6110</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-04-18T09:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up Splunk alert for changing logs?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345932#M6111</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;

&lt;P&gt;How many time can pass between "failure" and "success" events in your log? &lt;/P&gt;

&lt;P&gt;J.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 10:17:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345932#M6111</guid>
      <dc:creator>Javip</dc:creator>
      <dc:date>2018-04-18T10:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up Splunk alert for changing logs?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345933#M6112</link>
      <description>&lt;P&gt;Hi Javip,&lt;BR /&gt;
within 2 minutes...failure come back to success..but sometime it not happen and i need alert for this.&lt;BR /&gt;
Could you please help&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:19:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345933#M6112</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-04-18T13:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up Splunk alert for changing logs?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345934#M6113</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;As &lt;STRONG&gt;ssadanala1&lt;/STRONG&gt; said create a cheduled search to do something like this every 5 minutes, asking for your last 24h events perhaps:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup test_failure.csv 
| search status="failure" OR status="succcess" 
| head 1 
| eval event_time=_time, time_now=Now() 
| eval diff=time_now-event_time 
| search diff&amp;gt;=300 AND status="failure"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There, in my example, I filter events with status="failure" OR status="succcess"&lt;BR /&gt;
Then I only wants the most recent event, I use head 1&lt;BR /&gt;
The next I do is to create 2 timestamp variables, one with event time and the other one the result of Now() command&lt;BR /&gt;
I rest both values and finally I search if my last event has status=failure and if diff value is &amp;gt;300 then I send an alert.&lt;/P&gt;

&lt;P&gt;Obviously to can add more fields and send or use them for your alert/email.&lt;/P&gt;

&lt;P&gt;Tell me if these ideas can help you.&lt;/P&gt;

&lt;P&gt;J.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:44:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345934#M6113</guid>
      <dc:creator>Javip</dc:creator>
      <dc:date>2018-04-18T13:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up Splunk alert for changing logs?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345935#M6114</link>
      <description>&lt;P&gt;but if success comes first and followed by failure then it wont alert within 5 minutes of time frame&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 14:04:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345935#M6114</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-04-18T14:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up Splunk alert for changing logs?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345936#M6115</link>
      <description>&lt;P&gt;if success comes first, it's your most recent event, nothing happens &lt;/P&gt;

&lt;P&gt;if failure is your most recent event, then you'll send an alert when passed at least 5 minutes&lt;/P&gt;

&lt;P&gt;you only send alert or not according to two conditions: status="failure" and you've not received a success event in 5 minutes or more.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 14:18:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345936#M6115</guid>
      <dc:creator>Javip</dc:creator>
      <dc:date>2018-04-18T14:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up Splunk alert for changing logs?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345937#M6116</link>
      <description>&lt;P&gt;Wow!!.....greatest knowledge !!..&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 14:46:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345937#M6116</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-04-18T14:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up Splunk alert for changing logs?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345938#M6117</link>
      <description>&lt;P&gt;Hi Javip,&lt;BR /&gt;
i have modified query for this requirement&lt;/P&gt;

&lt;P&gt;index=ABC host=ABC sourcetype=ABC  "Success" OR "Failure"&lt;BR /&gt;
 | head 1 &lt;BR /&gt;
 | eval event_time=_time, time_now=Now() &lt;BR /&gt;
 | eval diff=time_now-event_time &lt;BR /&gt;
 | where diff&amp;gt;=300 AND like(_raw, "%Failure%")&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:08:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-set-up-Splunk-alert-for-changing-logs/m-p/345938#M6117</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2020-09-29T19:08:56Z</dc:date>
    </item>
  </channel>
</rss>

