<?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: Use subsearch result as filter in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339580#M100708</link>
    <description>&lt;P&gt;thanks, becasue the product code is not same on different index, 1 index is 1234 another index product code is short form for the product, (E,g ABC)&lt;BR /&gt;
that's why i use lookup to map it.&lt;/P&gt;

&lt;P&gt;but do you know why my subsearch not work?&lt;/P&gt;</description>
    <pubDate>Tue, 31 Oct 2017 13:06:35 GMT</pubDate>
    <dc:creator>kennethyeung</dc:creator>
    <dc:date>2017-10-31T13:06:35Z</dc:date>
    <item>
      <title>Use subsearch result as filter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339577#M100705</link>
      <description>&lt;P&gt;I have 2 indexes. 1 index has the price with product code&lt;BR /&gt;
Another index has product code and product name&lt;/P&gt;

&lt;P&gt;the subsearch is below:&lt;/P&gt;

&lt;P&gt;index=product code=1&lt;BR /&gt;
|  lookup code.csv product_code as code OUTPUT product_name as product_name&lt;BR /&gt;
| dedup product_name|  fields product_name ] &lt;/P&gt;

&lt;P&gt;it will return the product name , however if i use as subsearch, it will say no result&lt;/P&gt;

&lt;P&gt;index=price  [search index=product code=1&lt;BR /&gt;
|  lookup code.csv product_code as code OUTPUT product_name as product_name&lt;BR /&gt;
| dedup product_name|  fields product_name ] &lt;/P&gt;

&lt;P&gt;Actually, I want to filter name = subsearch result as well&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:31:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339577#M100705</guid>
      <dc:creator>kennethyeung</dc:creator>
      <dc:date>2020-09-29T16:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch result as filter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339578#M100706</link>
      <description>&lt;P&gt;Your subsearch should just get the results from the lookup e.g.&lt;/P&gt;

&lt;P&gt;|inputlookup code.csv where product_code=1 | table product_name&lt;/P&gt;

&lt;P&gt;Alternatively, you can replace index=product with below to make sure you always have data&lt;/P&gt;

&lt;P&gt;index=product earliest=0 latest=now&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:31:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339578#M100706</guid>
      <dc:creator>peterchenadded</dc:creator>
      <dc:date>2020-09-29T16:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch result as filter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339579#M100707</link>
      <description>&lt;P&gt;Hi kennethyeung,&lt;BR /&gt;
Only to understand:&lt;BR /&gt;
if in index2 you have code and product name: why do you use lookup?&lt;/P&gt;

&lt;P&gt;Anyway, probably the problem is in the case.&lt;BR /&gt;
Try to convert in upper o lower case both the searches.&lt;/P&gt;

&lt;P&gt;Or you could rebuild your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=price OR  index=product
| rename code AS product_code
| stats values(price) AS price values(product_name) AS product_name BY product_code
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 12:44:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339579#M100707</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-10-31T12:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch result as filter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339580#M100708</link>
      <description>&lt;P&gt;thanks, becasue the product code is not same on different index, 1 index is 1234 another index product code is short form for the product, (E,g ABC)&lt;BR /&gt;
that's why i use lookup to map it.&lt;/P&gt;

&lt;P&gt;but do you know why my subsearch not work?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 13:06:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339580#M100708</guid>
      <dc:creator>kennethyeung</dc:creator>
      <dc:date>2017-10-31T13:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch result as filter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339581#M100709</link>
      <description>&lt;P&gt;i tried put "|inputlookup code.csv where product_code=1 | table product_name" as subsearch but not working as well&lt;/P&gt;

&lt;P&gt;index=product [ inputlookup code.csv where product_code=1 | table product_name] no result found&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:31:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339581#M100709</guid>
      <dc:creator>kennethyeung</dc:creator>
      <dc:date>2020-09-29T16:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch result as filter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339582#M100710</link>
      <description>&lt;P&gt;Hi kennethyeung,&lt;BR /&gt;
probably the problem is in the case.&lt;BR /&gt;
Try to convert code and product_code in upper o lower case in both the searches.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 13:19:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339582#M100710</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-10-31T13:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch result as filter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339583#M100711</link>
      <description>&lt;P&gt;i found out have to add "return product_name"  at the subsearch , then work fine. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 15:41:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339583#M100711</guid>
      <dc:creator>kennethyeung</dc:creator>
      <dc:date>2017-10-31T15:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Use subsearch result as filter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339584#M100712</link>
      <description>&lt;P&gt;It needs to be | before the inputlookup.&lt;/P&gt;

&lt;P&gt;Did you also try the earliest and latest setting I suggested in previous comment?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 20:46:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-subsearch-result-as-filter/m-p/339584#M100712</guid>
      <dc:creator>peterchenadded</dc:creator>
      <dc:date>2017-10-31T20:46:48Z</dc:date>
    </item>
  </channel>
</rss>

