<?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: Why is my subsearch not working? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-subsearch-not-working/m-p/388421#M113255</link>
    <description>&lt;P&gt;Thanks, that was the trick. I had to use same field name for IP address in both queries. &lt;BR /&gt;
My final query which is working now:&lt;/P&gt;

&lt;P&gt;index=index1 sourcetype=sourcetype1 [search &lt;BR /&gt;
 index=index2 sourcetype=sourcetype2 category=category2 | table src | rename src as IP_address]&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jan 2019 01:45:25 GMT</pubDate>
    <dc:creator>utk123</dc:creator>
    <dc:date>2019-01-09T01:45:25Z</dc:date>
    <item>
      <title>Why is my subsearch not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-subsearch-not-working/m-p/388418#M113252</link>
      <description>&lt;P&gt;I am trying the below subsearch, but it's not giving any results. "No results found. Try expanding the time range. "&lt;/P&gt;

&lt;P&gt;I want to get the IP address from search2, and then use it in search1. &lt;/P&gt;

&lt;P&gt;Search1 (outer search): giving results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 sourcetype=sourcetype1 IP_address
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Search2 (inner search): giving results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index2 sourcetype=sourcetype2 category=category2 | top limit=1 src| table src
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;subsearch: not giving results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 sourcetype=sourcetype1 [search 
index=index2 sourcetype=sourcetype2 category=category2 | top limit=1 src| table src]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Am I missing anything here ?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 09:20:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-subsearch-not-working/m-p/388418#M113252</guid>
      <dc:creator>utk123</dc:creator>
      <dc:date>2019-01-08T09:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my subsearch not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-subsearch-not-working/m-p/388419#M113253</link>
      <description>&lt;P&gt;@utk123 , To get result of above subsearch, &lt;CODE&gt;src&lt;/CODE&gt; field result need to be present in Search 1.  If this criteria is fulfilled, then query will work.    n events will be return by search.&lt;/P&gt;

&lt;P&gt;Please refer below queries - &lt;BR /&gt;
Below query will return the result- &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal group=pipeline
    [search index=_internal component=Metrics | top limit=1 name | table name]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Below Query might not return a result &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal group=executor
    [search index=_internal component=Metrics | top limit=1 name | table name]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;PS:&lt;/STRONG&gt; Above queries are heavy query.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 13:00:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-subsearch-not-working/m-p/388419#M113253</guid>
      <dc:creator>askkawalkar</dc:creator>
      <dc:date>2019-01-08T13:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my subsearch not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-subsearch-not-working/m-p/388420#M113254</link>
      <description>&lt;P&gt;@utk123 try the following search. &lt;CODE&gt;rename src as IP_address&lt;/CODE&gt; is required as &lt;CODE&gt;index1&lt;/CODE&gt; has field &lt;CODE&gt;IP_address&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 sourcetype=sourcetype1 
    [ search 
        index=index2 sourcetype=sourcetype2 category=category2 
    | top limit=1 src showcount=f showperc=f 
    | rename src as IP_address]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Jan 2019 14:34:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-subsearch-not-working/m-p/388420#M113254</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-01-08T14:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my subsearch not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-subsearch-not-working/m-p/388421#M113255</link>
      <description>&lt;P&gt;Thanks, that was the trick. I had to use same field name for IP address in both queries. &lt;BR /&gt;
My final query which is working now:&lt;/P&gt;

&lt;P&gt;index=index1 sourcetype=sourcetype1 [search &lt;BR /&gt;
 index=index2 sourcetype=sourcetype2 category=category2 | table src | rename src as IP_address]&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 01:45:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-subsearch-not-working/m-p/388421#M113255</guid>
      <dc:creator>utk123</dc:creator>
      <dc:date>2019-01-09T01:45:25Z</dc:date>
    </item>
  </channel>
</rss>

