<?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 Subsearch question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-question/m-p/47322#M11295</link>
    <description>&lt;P&gt;I have a large search:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search index="XXX"&lt;/CODE&gt; which has host as field. This includes data for two locations.&lt;/P&gt;

&lt;P&gt;I need to filter search that for hosts that exist in each location (Z,Y). &lt;/P&gt;

&lt;P&gt;I setup an inputlookup for host.csv with 2 columns and did the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup host.csv | fields MAC,Location | where Location="Z" | rename MAC as host|
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've added that to my larger search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search index="XXX" | join host [|inputlookup host.csv | fields MAC,Location | where Location="Z" | rename MAC as host] | dedup host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However the results are little inconsistent. Based on the CSV I see 584 hosts for Z and 250 hosts for Y. However my search only finds some of these -- i.e 420 for Z and 196 for Y.&lt;/P&gt;

&lt;P&gt;I "think" this is a result of all hosts not appearing in the index, but I'm also a little unsure of the join I used.&lt;/P&gt;

&lt;P&gt;Any help/advice is appreciated! &lt;/P&gt;</description>
    <pubDate>Fri, 22 Jul 2011 20:05:05 GMT</pubDate>
    <dc:creator>lokispundit</dc:creator>
    <dc:date>2011-07-22T20:05:05Z</dc:date>
    <item>
      <title>Subsearch question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-question/m-p/47322#M11295</link>
      <description>&lt;P&gt;I have a large search:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search index="XXX"&lt;/CODE&gt; which has host as field. This includes data for two locations.&lt;/P&gt;

&lt;P&gt;I need to filter search that for hosts that exist in each location (Z,Y). &lt;/P&gt;

&lt;P&gt;I setup an inputlookup for host.csv with 2 columns and did the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup host.csv | fields MAC,Location | where Location="Z" | rename MAC as host|
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've added that to my larger search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search index="XXX" | join host [|inputlookup host.csv | fields MAC,Location | where Location="Z" | rename MAC as host] | dedup host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However the results are little inconsistent. Based on the CSV I see 584 hosts for Z and 250 hosts for Y. However my search only finds some of these -- i.e 420 for Z and 196 for Y.&lt;/P&gt;

&lt;P&gt;I "think" this is a result of all hosts not appearing in the index, but I'm also a little unsure of the join I used.&lt;/P&gt;

&lt;P&gt;Any help/advice is appreciated! &lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2011 20:05:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-question/m-p/47322#M11295</guid>
      <dc:creator>lokispundit</dc:creator>
      <dc:date>2011-07-22T20:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-question/m-p/47323#M11296</link>
      <description>&lt;P&gt;Can you add a little more information about what you're trying to do?  &lt;/P&gt;

&lt;P&gt;Reading your description I'm not sure you need to be using join at all. It seems almost like what you're trying to do is as simple as: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="XXX" | lookup hosts MAC as host OUTPUT Location | where Location="Z" | stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Jul 2011 01:15:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-question/m-p/47323#M11296</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-07-23T01:15:07Z</dc:date>
    </item>
  </channel>
</rss>

