<?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 send alert for consecutive field values failure in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-send-alert-for-consecutive-field-values-failure/m-p/477122#M8456</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="job   job_name  time job_result
abc   abc_job   14:20 Failure
def   def_job   15:30 Failure
ghi   ghi_job   12:22 Failure
annc  annc_job  14:20 Failure
defff defff_job 15:30 Failure
ghhhi ghhhi_job 12:22 Failure
abc   abc_job   14:20 Success
def   def_job   15:30 Failure
ghi   ghi_job   12:22 Failure
annc  annc_job  14:20 Failure
defff defff_job 15:30 Failure
ghhhi ghhhi_job 12:22 Failure"
| multikv forceheader=1 
| table job job_name time job_result
| streamstats reset_on_change=t count(eval(job_result="Failure")) as fail_count by job_result
| eventstats max(fail_count) as alert_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/121510"&gt;@manish_singh_77&lt;/a&gt;7&lt;BR /&gt;
this is sample code.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search
| table job job_name time job_result
| streamstats reset_on_change=t count(eval(job_result="Failure")) as fail_count by job_result
| eventstats max(fail_count) as alert_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;alert_count &amp;gt; 5&lt;/CODE&gt;, fire alert.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 03:33:15 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-09-30T03:33:15Z</dc:date>
    <item>
      <title>How to send alert for consecutive field values failure</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-send-alert-for-consecutive-field-values-failure/m-p/477121#M8455</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have a table where we have job_result field, whenever job_result field has "failure" value for consecutive 5 times then we need to set up an alert.&lt;/P&gt;

&lt;P&gt;Example&lt;/P&gt;

&lt;P&gt;job  job _name time job result&lt;BR /&gt;
abc abc_job 14:20 Failure&lt;BR /&gt;
def def_job 15:30 Failure&lt;BR /&gt;
ghi ghi_job 12:22 Failure&lt;BR /&gt;
annc annc_job 14:20 Failure&lt;BR /&gt;
defff defff_job 15:30 Failure&lt;BR /&gt;
ghhhi ghhhi_job 12:22 Failure&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:33:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-send-alert-for-consecutive-field-values-failure/m-p/477121#M8455</guid>
      <dc:creator>manish_singh_77</dc:creator>
      <dc:date>2020-09-30T03:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to send alert for consecutive field values failure</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-send-alert-for-consecutive-field-values-failure/m-p/477122#M8456</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="job   job_name  time job_result
abc   abc_job   14:20 Failure
def   def_job   15:30 Failure
ghi   ghi_job   12:22 Failure
annc  annc_job  14:20 Failure
defff defff_job 15:30 Failure
ghhhi ghhhi_job 12:22 Failure
abc   abc_job   14:20 Success
def   def_job   15:30 Failure
ghi   ghi_job   12:22 Failure
annc  annc_job  14:20 Failure
defff defff_job 15:30 Failure
ghhhi ghhhi_job 12:22 Failure"
| multikv forceheader=1 
| table job job_name time job_result
| streamstats reset_on_change=t count(eval(job_result="Failure")) as fail_count by job_result
| eventstats max(fail_count) as alert_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/121510"&gt;@manish_singh_77&lt;/a&gt;7&lt;BR /&gt;
this is sample code.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search
| table job job_name time job_result
| streamstats reset_on_change=t count(eval(job_result="Failure")) as fail_count by job_result
| eventstats max(fail_count) as alert_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;alert_count &amp;gt; 5&lt;/CODE&gt;, fire alert.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:33:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-send-alert-for-consecutive-field-values-failure/m-p/477122#M8456</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-09-30T03:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to send alert for consecutive field values failure</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-send-alert-for-consecutive-field-values-failure/m-p/477123#M8457</link>
      <description>&lt;P&gt;Hi @to4kawa &lt;/P&gt;

&lt;P&gt;I want to send an alert if specific job is failing for 5 consecutive times.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 11:30:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-send-alert-for-consecutive-field-values-failure/m-p/477123#M8457</guid>
      <dc:creator>manish_singh_77</dc:creator>
      <dc:date>2020-01-17T11:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to send alert for consecutive field values failure</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-send-alert-for-consecutive-field-values-failure/m-p/477124#M8458</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;your_search
 | table job job_name time job_result
 | streamstats reset_on_change=t count(eval(job="abc" AND job_result="Failure")) as fail_count by job_result
 | eventstats max(fail_count) as alert_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;please add &lt;EM&gt;job&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 14:16:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-send-alert-for-consecutive-field-values-failure/m-p/477124#M8458</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-17T14:16:16Z</dc:date>
    </item>
  </channel>
</rss>

