<?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 the result from an index of the 1st search as input to return results from another index in a 2nd search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-result-from-an-index-of-the-1st-search-as-input/m-p/161007#M45555</link>
    <description>&lt;P&gt;You need the &lt;CODE&gt;map&lt;/CODE&gt; command, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;first search that generates a list of events that have the "_time" values you need | map search = "search earliest&amp;gt;(_time-60) latest&amp;lt;(time+60) some other search"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also use the &lt;CODE&gt;FOREACH&lt;/CODE&gt; command.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jun 2015 13:10:01 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-06-18T13:10:01Z</dc:date>
    <item>
      <title>How to use the result from an index of the 1st search as input to return results from another index in a 2nd search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-result-from-an-index-of-the-1st-search-as-input/m-p/161006#M45554</link>
      <description>&lt;P&gt;I am getting output for max hits at particular date and hour for a 1st search having &lt;CODE&gt;index=iis&lt;/CODE&gt;. Now i want the date and hour from the 1st search to be input for 2nd search to find result for &lt;CODE&gt;index=perfmon&lt;/CODE&gt; and show output fields of both searches.&lt;/P&gt;

&lt;P&gt;Is it possible?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2015 12:51:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-result-from-an-index-of-the-1st-search-as-input/m-p/161006#M45554</guid>
      <dc:creator>shreyasathavale</dc:creator>
      <dc:date>2015-06-18T12:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the result from an index of the 1st search as input to return results from another index in a 2nd search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-result-from-an-index-of-the-1st-search-as-input/m-p/161007#M45555</link>
      <description>&lt;P&gt;You need the &lt;CODE&gt;map&lt;/CODE&gt; command, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;first search that generates a list of events that have the "_time" values you need | map search = "search earliest&amp;gt;(_time-60) latest&amp;lt;(time+60) some other search"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also use the &lt;CODE&gt;FOREACH&lt;/CODE&gt; command.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2015 13:10:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-result-from-an-index-of-the-1st-search-as-input/m-p/161007#M45555</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-18T13:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the result from an index of the 1st search as input to return results from another index in a 2nd search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-result-from-an-index-of-the-1st-search-as-input/m-p/161008#M45556</link>
      <description>&lt;P&gt;I am trying this..Meanwhile could you please tell if it is possible:&lt;/P&gt;

&lt;P&gt;1st query output:&lt;BR /&gt;
date_hour   date_mday&lt;BR /&gt;
4                    15&lt;/P&gt;

&lt;P&gt;2nd query output using hour and day of 1st query ouput&lt;BR /&gt;
host            counter                 avg(Value)&lt;BR /&gt;
1552    % Processor Time    20.611920&lt;/P&gt;

&lt;P&gt;I want&lt;BR /&gt;
date_hour   date_mday  host  counter avg(Value)&lt;BR /&gt;
4                     15                ms..   ....          ...&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:17:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-result-from-an-index-of-the-1st-search-as-input/m-p/161008#M45556</guid>
      <dc:creator>shreyasathavale</dc:creator>
      <dc:date>2020-09-28T20:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the result from an index of the 1st search as input to return results from another index in a 2nd search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-result-from-an-index-of-the-1st-search-as-input/m-p/161009#M45557</link>
      <description>&lt;P&gt;OK, I think you are asking for something different than is implied by your original text.  It sounds like you are trying to do a &lt;CODE&gt;join&lt;/CODE&gt; (merge) by &lt;CODE&gt;host&lt;/CODE&gt;.  If so, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(first query here | eval datehour=date_hour | eval datemday=date_mday) OR (second query here) | stats avg(Value) values(counter) AS counter values(datehour) AS datehour values(datemday) AS datemday by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Jun 2015 14:16:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-result-from-an-index-of-the-1st-search-as-input/m-p/161009#M45557</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-18T14:16:48Z</dc:date>
    </item>
  </channel>
</rss>

