<?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 use inputlookup count of results as a filter for the main search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-count-of-results-as-a-filter-for-the-main/m-p/186269#M53654</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{blablabla} | stats dc(host) as by ApplicationName, Version | eval ServerCountLookup=[ | inputlookup lookup table | search Destination="PROD" | stats count(host) as count | return $count] | your comparison here...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 26 Aug 2015 16:57:32 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2015-08-26T16:57:32Z</dc:date>
    <item>
      <title>How to use inputlookup count of results as a filter for the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-count-of-results-as-a-filter-for-the-main/m-p/186268#M53653</link>
      <description>&lt;P&gt;So I have a search which pulls the number of servers in a farm that have the "X" application installed on them. Now I have a csv file I do a lookup into, which keeps the server status (Production/Testing/etc).&lt;/P&gt;

&lt;P&gt;What I did was:&lt;BR /&gt;
 - to get from the main search a result which counts the number of servers where it is installed&lt;BR /&gt;
 - it displays Application Name | count of servers which have it installed&lt;/P&gt;

&lt;P&gt;What I want to do now is to count the number of results from within a lookup and compare the results described above in the main search with this result, if there are differences, I woul like to keep from the main search only the applications which are not installed on the same &lt;BR /&gt;
number of servers as the inputlookup results.&lt;/P&gt;

&lt;P&gt;SO:&lt;BR /&gt;
Main search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{blablabla} | stats dc(host) by ApplicationName, Version
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Subsearch would be: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup *lookup table* | search Destination=*"PROD"* | stats count(host) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(which in this particular case returns 89)&lt;BR /&gt;
And I need to compare the number of servers which have the same ApplicationName on them with 89 resulted above&lt;/P&gt;

&lt;P&gt;Any help is highly appreciated&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2015 13:06:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-count-of-results-as-a-filter-for-the-main/m-p/186268#M53653</guid>
      <dc:creator>sergiupopescu</dc:creator>
      <dc:date>2015-08-26T13:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use inputlookup count of results as a filter for the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-count-of-results-as-a-filter-for-the-main/m-p/186269#M53654</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{blablabla} | stats dc(host) as by ApplicationName, Version | eval ServerCountLookup=[ | inputlookup lookup table | search Destination="PROD" | stats count(host) as count | return $count] | your comparison here...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Aug 2015 16:57:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-count-of-results-as-a-filter-for-the-main/m-p/186269#M53654</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-26T16:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to use inputlookup count of results as a filter for the main search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-count-of-results-as-a-filter-for-the-main/m-p/186270#M53655</link>
      <description>&lt;P&gt;Works perfect, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 09:46:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-inputlookup-count-of-results-as-a-filter-for-the-main/m-p/186270#M53655</guid>
      <dc:creator>sergiupopescu</dc:creator>
      <dc:date>2015-08-27T09:46:10Z</dc:date>
    </item>
  </channel>
</rss>

