<?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: retrieve host count depending on host value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/retrieve-host-count-depending-on-host-value/m-p/284430#M86001</link>
    <description>&lt;P&gt;Just set a custom condition on the alert:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search (host!=Total AND hostCount&amp;lt;2) OR (host=Total AND hostCount&amp;lt;12)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 Apr 2016 13:55:56 GMT</pubDate>
    <dc:creator>mlf</dc:creator>
    <dc:date>2016-04-06T13:55:56Z</dc:date>
    <item>
      <title>retrieve host count depending on host value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/retrieve-host-count-depending-on-host-value/m-p/284428#M85999</link>
      <description>&lt;P&gt;Hi, I'm trying to accomplish the following:&lt;BR /&gt;
 * alert when there is a host that has less than 2 occurences&lt;BR /&gt;
 * alert when the total count is less than 12&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=vts sourcetype=vtsr host=server* "Batch Processor is turned ON" | stats count(host) as hostCount by host | addcoltotals labelfield=host

host               hostCount
server 1           3
server 2           3
server 3           2
server 4           2
server 5           2
server 6           2
Total              14
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I validate for each server and total count values just to specify when to trigger the alert?&lt;/P&gt;

&lt;P&gt;Regards!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 13:38:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/retrieve-host-count-depending-on-host-value/m-p/284428#M85999</guid>
      <dc:creator>marcosrios</dc:creator>
      <dc:date>2016-04-06T13:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve host count depending on host value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/retrieve-host-count-depending-on-host-value/m-p/284429#M86000</link>
      <description>&lt;P&gt;Add this on:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eventstats count(eval(host!="Total" AND hostCount&amp;lt;2)) AS Trigger1 last(hostCount) AS Trigger2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then trigger your alert on "Trigger1&amp;gt;0 AND Trigger2&amp;lt;12"&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 13:45:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/retrieve-host-count-depending-on-host-value/m-p/284429#M86000</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-04-06T13:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve host count depending on host value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/retrieve-host-count-depending-on-host-value/m-p/284430#M86001</link>
      <description>&lt;P&gt;Just set a custom condition on the alert:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search (host!=Total AND hostCount&amp;lt;2) OR (host=Total AND hostCount&amp;lt;12)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Apr 2016 13:55:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/retrieve-host-count-depending-on-host-value/m-p/284430#M86001</guid>
      <dc:creator>mlf</dc:creator>
      <dc:date>2016-04-06T13:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: retrieve host count depending on host value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/retrieve-host-count-depending-on-host-value/m-p/284431#M86002</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=vts sourcetype=vtsr host=server* "Batch Processor is turned ON" | stats count(host) as hostCount by host | eventstats sum(hostCount) as total | where hostCount&amp;lt;2 OR total&amp;lt;12
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Apr 2016 14:06:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/retrieve-host-count-depending-on-host-value/m-p/284431#M86002</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-06T14:06:35Z</dc:date>
    </item>
  </channel>
</rss>

