<?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 the result from first search into second search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331398#M160781</link>
    <description>&lt;P&gt;i have tow fields in the each index the first one fildes1 for index1 and second fields2 for index2&lt;/P&gt;

&lt;P&gt;index=index2 [search index=index1|fields1] | where fields2 like "%fields1%" | table fields2&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2017 12:57:58 GMT</pubDate>
    <dc:creator>younes17</dc:creator>
    <dc:date>2017-06-09T12:57:58Z</dc:date>
    <item>
      <title>Use the result from first search into second search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331393#M160776</link>
      <description>&lt;P&gt;I have an first search that will find the software list&lt;BR /&gt;
search index=index1 | table software&lt;/P&gt;

&lt;P&gt;in the second search, i need use the result of first search to find the match result with "where" command.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 12:02:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331393#M160776</guid>
      <dc:creator>younes17</dc:creator>
      <dc:date>2017-06-09T12:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Use the result from first search into second search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331394#M160777</link>
      <description>&lt;P&gt;A &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.6.0/SearchTutorial/Useasubsearch"&gt;subsearch&lt;/A&gt;...&lt;/P&gt;

&lt;P&gt;Usually/often used like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index2 [search index=index1 | table software]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If your subsearch returns "Office" and "Windows" then the entire search after running it becomes &lt;CODE&gt;index=index2 AND (software=Office OR software=Windows)&lt;/CODE&gt;.  &lt;/P&gt;

&lt;P&gt;If you specifically need to use where, it should still work the same.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index2  ... | where search [index=index1 | table software]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But, there are comparison cases where it gets just a tiny bit trickier.  If you could provide the search you are actually using, it might be easier to get a really specific answer.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 12:23:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331394#M160777</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2017-06-09T12:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Use the result from first search into second search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331395#M160778</link>
      <description>&lt;P&gt;You question is not very specific, so there are many answers depending on the context. Suppose you second search is "index=index2" and there is a field called software, then you could use a subsearch as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index2 [search index=index1|fields software]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the field in the second search is package instead of software, then you can do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index2 [search index=index1|rename software as package|fields package]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2017 12:27:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331395#M160778</guid>
      <dc:creator>reed_kelly</dc:creator>
      <dc:date>2017-06-09T12:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Use the result from first search into second search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331396#M160779</link>
      <description>&lt;P&gt;i have tow fields in the each index the first one fildes1 for index1 and second fields2 for index2&lt;/P&gt;

&lt;P&gt;index=index2 [search index=index1|fields1] | where fields2 like "%fields1%" | table fields2&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 12:48:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331396#M160779</guid>
      <dc:creator>younes17</dc:creator>
      <dc:date>2017-06-09T12:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Use the result from first search into second search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331397#M160780</link>
      <description>&lt;P&gt;i have tow fields in the each index the first one fildes1 for index1 and second fields2 for index2&lt;/P&gt;

&lt;P&gt;index=index2 [search index=index1|fields1] | where fields2 like "%fields1%" | table fields2&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 12:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331397#M160780</guid>
      <dc:creator>younes17</dc:creator>
      <dc:date>2017-06-09T12:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Use the result from first search into second search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331398#M160781</link>
      <description>&lt;P&gt;i have tow fields in the each index the first one fildes1 for index1 and second fields2 for index2&lt;/P&gt;

&lt;P&gt;index=index2 [search index=index1|fields1] | where fields2 like "%fields1%" | table fields2&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 12:57:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331398#M160781</guid>
      <dc:creator>younes17</dc:creator>
      <dc:date>2017-06-09T12:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Use the result from first search into second search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331399#M160782</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index2 [search index=index1 | table fields1 | eval fields2="*".fields1."*" | table fields 2]  | table fields2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2017 14:50:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331399#M160782</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-06-09T14:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Use the result from first search into second search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331400#M160783</link>
      <description>&lt;P&gt;I think you mistake the where command with the SQL where. They are two different things. To achieve what you are looking for with a subsearch, you can do the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index2 [search index=index1|eval fields2="*"+field1+"*"|fields field2]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Depending on what you are trying to achieve this can be made more efficient, but the "*" in search is similar to SQL '%'&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 16:21:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-the-result-from-first-search-into-second-search/m-p/331400#M160783</guid>
      <dc:creator>reed_kelly</dc:creator>
      <dc:date>2017-06-09T16:21:07Z</dc:date>
    </item>
  </channel>
</rss>

