<?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: Trigger alert only if the result contain more than one host in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454825#M8027</link>
    <description>&lt;P&gt;Have you tried something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=msexchange recipient_status="451 4.3.2 *" | stats dc(host) as host_count by host | where host_count &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could also do some sort of combo like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=msexchange recipient_status="451 4.3.2 *" | stats count dc(host) as host_count by host | where ( host_count &amp;gt; 1 AND count &amp;gt; 100 )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;H3&gt;Note: edited to fix a bug&lt;/H3&gt;</description>
    <pubDate>Tue, 20 Aug 2019 16:15:44 GMT</pubDate>
    <dc:creator>sheamus69</dc:creator>
    <dc:date>2019-08-20T16:15:44Z</dc:date>
    <item>
      <title>Trigger alert only if the result contain more than one host</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454824#M8026</link>
      <description>&lt;P&gt;Hey Everyone,&lt;/P&gt;

&lt;P&gt;I have an alert set up that triggers when any host has more than 100 events in 5 minutes. Here is the exact search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=msexchange recipient_status="451 4.3.2 *" | stats count by host | where count &amp;gt; 100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the results of this search only shows a host if its event count is &amp;gt; 100 and it shows the exact count for each host. I want to alter this alert to show the same results, but only trigger if there is more than one host. Is there a way to do this? I have tried embedding a stats command inside of another stats command but I have had no luck.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 16:01:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454824#M8026</guid>
      <dc:creator>sjcoluccio67</dc:creator>
      <dc:date>2019-08-20T16:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger alert only if the result contain more than one host</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454825#M8027</link>
      <description>&lt;P&gt;Have you tried something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=msexchange recipient_status="451 4.3.2 *" | stats dc(host) as host_count by host | where host_count &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could also do some sort of combo like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=msexchange recipient_status="451 4.3.2 *" | stats count dc(host) as host_count by host | where ( host_count &amp;gt; 1 AND count &amp;gt; 100 )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;H3&gt;Note: edited to fix a bug&lt;/H3&gt;</description>
      <pubDate>Tue, 20 Aug 2019 16:15:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454825#M8027</guid>
      <dc:creator>sheamus69</dc:creator>
      <dc:date>2019-08-20T16:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger alert only if the result contain more than one host</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454826#M8028</link>
      <description>&lt;P&gt;When you save the search as an alert under trigger conditions you can select number of hosts for the "Trigger alert when" field and set it to is greater than 1.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 16:15:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454826#M8028</guid>
      <dc:creator>lmonteith</dc:creator>
      <dc:date>2019-08-20T16:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger alert only if the result contain more than one host</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454827#M8029</link>
      <description>&lt;P&gt;Have you tried something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=msexchange recipient_status="451 4.3.2 *" | stats dc(host) as host_count by host | where host_count &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could also do some sort of combo like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=msexchange recipient_status="451 4.3.2 *" | stats count dc(host) as host_count by host | where ( host_count &amp;gt; 1 AND count &amp;gt; 100 )
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Aug 2019 16:20:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454827#M8029</guid>
      <dc:creator>sheamus69</dc:creator>
      <dc:date>2019-08-20T16:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger alert only if the result contain more than one host</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454828#M8030</link>
      <description>&lt;P&gt;@sjcoluccio67 You can keep your query as it is , and in the alert configuration -&amp;gt; Edit Alert -&amp;gt; Trigger Conditions-&amp;gt;Trigger Alert when Number of Results  &amp;gt;1 &lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 16:26:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454828#M8030</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-08-20T16:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger alert only if the result contain more than one host</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454829#M8031</link>
      <description>&lt;P&gt;Does this work for you?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=msexchange recipient_status="451 4.3.2 *"  | stats count by host | where count &amp;gt; 100
| eventstats dc(host) as Hostcount 
| where Hostcount &amp;gt; 1
| fields - Hostcount
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should display all hosts and their counts if the total number of hosts &amp;gt; 1.  If the total number of hosts is &amp;lt; 2 -- then nothing displays.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 16:38:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454829#M8031</guid>
      <dc:creator>memarshall63</dc:creator>
      <dc:date>2019-08-20T16:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger alert only if the result contain more than one host</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454830#M8032</link>
      <description>&lt;P&gt;I have tried this, but host_count will never be greater than one because it counts each host individually. Here is what the results look like:&lt;/P&gt;

&lt;P&gt;host    |   count    |   host_count&lt;BR /&gt;
            |                 |&lt;BR /&gt;&lt;BR /&gt;
xxx01  |  107        |  1&lt;BR /&gt;
xxx02  |  36          |  1&lt;BR /&gt;
xxx07  |  57          |  1&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 17:14:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454830#M8032</guid>
      <dc:creator>sjcoluccio67</dc:creator>
      <dc:date>2019-08-20T17:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger alert only if the result contain more than one host</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454831#M8033</link>
      <description>&lt;P&gt;well, my formatting got messed up there^. I tried to make a table.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 17:14:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-alert-only-if-the-result-contain-more-than-one-host/m-p/454831#M8033</guid>
      <dc:creator>sjcoluccio67</dc:creator>
      <dc:date>2019-08-20T17:14:57Z</dc:date>
    </item>
  </channel>
</rss>

