<?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: Search question - where clause... in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-question-where-clause/m-p/92637#M23920</link>
    <description>&lt;P&gt;That looks like it does what I want - Thanks!&lt;/P&gt;

&lt;P&gt;nbc&lt;/P&gt;</description>
    <pubDate>Mon, 22 Nov 2010 21:58:43 GMT</pubDate>
    <dc:creator>nbcohen</dc:creator>
    <dc:date>2010-11-22T21:58:43Z</dc:date>
    <item>
      <title>Search question - where clause...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-question-where-clause/m-p/92635#M23918</link>
      <description>&lt;P&gt;I'm new to this, and not sure exactly what I'm doing yet - making progress, but still have a ways to go... I have managed to create a search string that gets most of the information I'm looking for. It looks like this:&lt;/P&gt;

&lt;P&gt;index="mydata" |stats dc(Hostname) as NumHost, count as EventCount by supportGroup&lt;/P&gt;

&lt;P&gt;This produces a table that looks like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;supportGroup    NumHost     EventCount
AAAAA              3               22
BBBBB              1                2
CCCCC             22              222
DDDDD              8               16
EEEEE             43             4670
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So far, so good. But in fact, I only want to select hosts where the event count FOR THOSE HOSTS is &amp;gt; some threshold (say 100 events). If I redo the query:&lt;/P&gt;

&lt;P&gt;index="mydata" |stats dc(Hostname) as NumHost, count as EventCount by supportGroup | where EventCount &amp;gt; 100&lt;/P&gt;

&lt;P&gt;That would eliminate rows AAAAA, BBBBB, and DDDDD from the table, but in group BBBBB, I may have 21 hosts with one event each, and one host with 201 events - I want to select only that one host (and the count should be 201, not 222). I have not been able to figure out how to state my query to make this happen - can someone point me at a tutorial that works out something like this, or give me a clue on how to structure such a query?&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;/P&gt;

&lt;P&gt;nbc&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2010 01:49:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-question-where-clause/m-p/92635#M23918</guid>
      <dc:creator>nbcohen</dc:creator>
      <dc:date>2010-11-20T01:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Search question - where clause...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-question-where-clause/m-p/92636#M23919</link>
      <description>&lt;P&gt;Seems like you chould:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=mydata 
| stats count, first(supportGroup) as supportGroup 
  by Hostname 
| where count&amp;gt; 100 
| stats dc(Hostname) as NumHost, sum(count) as EventCount 
  by supportGroup
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 20 Nov 2010 06:43:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-question-where-clause/m-p/92636#M23919</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-11-20T06:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Search question - where clause...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-question-where-clause/m-p/92637#M23920</link>
      <description>&lt;P&gt;That looks like it does what I want - Thanks!&lt;/P&gt;

&lt;P&gt;nbc&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2010 21:58:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-question-where-clause/m-p/92637#M23920</guid>
      <dc:creator>nbcohen</dc:creator>
      <dc:date>2010-11-22T21:58:43Z</dc:date>
    </item>
  </channel>
</rss>

