<?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: Alert custom condition in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Alert-custom-condition/m-p/494334#M12781</link>
    <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="iway_idoc" AND TMSG_TYPE="SAP_PLANARRIV"
| stats count BY STATUS
| where match(STATUS, "Error") AND count &amp;gt; 0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Nov 2019 18:30:27 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-11-27T18:30:27Z</dc:date>
    <item>
      <title>Alert custom condition</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-custom-condition/m-p/494330#M12777</link>
      <description>&lt;P&gt;My alert search query is like this which runs every 5mins&lt;BR /&gt;
&lt;STRONG&gt;index="iway_idoc" TMSG_TYPE="SAP_PLANARRIV" | table STATUS&lt;/STRONG&gt;&lt;BR /&gt;
the resultant records can have 2 different status  - Delivered and Error&lt;/P&gt;

&lt;P&gt;Now, I want to trigger an email if at-least one record with Error is found. I tried giving custom search like &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;search STATUS=Error&lt;BR /&gt;
search count(eval(STATUS="Error")) &amp;gt; 1&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;It didn't work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Can someone help in this please ??&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:09:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-custom-condition/m-p/494330#M12777</guid>
      <dc:creator>dhivyamu</dc:creator>
      <dc:date>2020-09-30T03:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Alert custom condition</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-custom-condition/m-p/494331#M12778</link>
      <description>&lt;P&gt;Could you try this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="iway_idoc" TMSG_TYPE="SAP_PLANARRIV" 
| table STATUS
| search STATUS=Error
| stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will count the records with STATUS=Error and then you can configure your alert to trigger if the count &amp;gt; 0.&lt;/P&gt;

&lt;P&gt;For aggregate/statistical operations you should use &lt;STRONG&gt;stats&lt;/STRONG&gt; command: &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.0.0/SearchReference/Stats"&gt;https://docs.splunk.com/Documentation/SplunkCloud/8.0.0/SearchReference/Stats&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope it helps!!!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 16:15:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-custom-condition/m-p/494331#M12778</guid>
      <dc:creator>jaime_ramirez</dc:creator>
      <dc:date>2019-11-27T16:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Alert custom condition</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-custom-condition/m-p/494332#M12779</link>
      <description>&lt;P&gt;HI @dhivyamu,&lt;BR /&gt;
try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="iway_idoc" TMSG_TYPE="SAP_PLANARRIV" STATUS=Error
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alert must be triggered when results are grether than 0&lt;BR /&gt;
In othe words: if you have results you have errors.&lt;/P&gt;

&lt;P&gt;You could also add a command to display e.g. the host list or the module list to have in the alert more infos.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 16:21:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-custom-condition/m-p/494332#M12779</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-11-27T16:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Alert custom condition</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-custom-condition/m-p/494333#M12780</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index="iway_idoc" TMSG_TYPE="SAP_PLANARRIV" STATUS=Error
|stats count by your_important_message_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, folks.&lt;BR /&gt;
If you set it up as @jaime.ramirez says and write &lt;CODE&gt;$result.your_inportant_message_field$&lt;/CODE&gt; in the body, you'll get better.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 16:27:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-custom-condition/m-p/494333#M12780</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-27T16:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Alert custom condition</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-custom-condition/m-p/494334#M12781</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="iway_idoc" AND TMSG_TYPE="SAP_PLANARRIV"
| stats count BY STATUS
| where match(STATUS, "Error") AND count &amp;gt; 0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Nov 2019 18:30:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-custom-condition/m-p/494334#M12781</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-27T18:30:27Z</dc:date>
    </item>
  </channel>
</rss>

