<?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 Using values from search into subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-values-from-search-into-subsearch/m-p/449258#M127222</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;In a timerange (lets say 4 hours) I am trying to find password resets and after that, for the same user, all the logins.&lt;BR /&gt;
Is it possible to this in a search? I was looking at append but I don't see how I can use the field user and _time from first search (finding the password resets) to filter the second search (finding the logins)&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2019 09:09:03 GMT</pubDate>
    <dc:creator>hoytn</dc:creator>
    <dc:date>2019-06-26T09:09:03Z</dc:date>
    <item>
      <title>Using values from search into subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-values-from-search-into-subsearch/m-p/449258#M127222</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;In a timerange (lets say 4 hours) I am trying to find password resets and after that, for the same user, all the logins.&lt;BR /&gt;
Is it possible to this in a search? I was looking at append but I don't see how I can use the field user and _time from first search (finding the password resets) to filter the second search (finding the logins)&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 09:09:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-values-from-search-into-subsearch/m-p/449258#M127222</guid>
      <dc:creator>hoytn</dc:creator>
      <dc:date>2019-06-26T09:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using values from search into subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-values-from-search-into-subsearch/m-p/449259#M127223</link>
      <description>&lt;P&gt;I recommend taking as much time as is necessary to fully understand the &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchTutorial/Useasubsearch"&gt;fine tutorial in the docs&lt;/A&gt;.  Of course that requires having set up and gone through the tutorial...&lt;/P&gt;

&lt;P&gt;Another good resource is also in the docs, the &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/Search/Aboutsubsearches"&gt;page about subsearches&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;When you have really tried to understand those two things, try your search/subsearch again and see where that gets you.&lt;/P&gt;

&lt;P&gt;Then maybe this helps - the subsearch RUNS FIRST.  Right?  It runs, and its results get shoved into the main search as search criteria.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;mybasesearch [some search that returns a name of either "Billy" or "Sally"]&lt;/CODE&gt;&lt;BR /&gt;
Ends up being&lt;BR /&gt;
&lt;CODE&gt;mybasesearch (name=Billy OR name=Sally)&lt;/CODE&gt;&lt;BR /&gt;
E.g the subsearch JUST returns its results as search items.&lt;/P&gt;

&lt;P&gt;(More or less.  Unless you change the formatting.  Etc... But I mean by default).&lt;/P&gt;

&lt;P&gt;if you've tried both things mentioned in the help, an yet still have problems,  post your SPL  and both the results you get, but also the results you'd expect to have.  And a few events from the results of the search (without subsearch) and the subsearch (run independently from the search). &lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2019 02:34:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-values-from-search-into-subsearch/m-p/449259#M127223</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2019-06-30T02:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using values from search into subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-values-from-search-into-subsearch/m-p/449260#M127224</link>
      <description>&lt;P&gt;You probably need something along these lines (adjust fields and indexes as needed)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=auth type=login [search index=auth type=failed  earliest=-4h |stats count by user |fields user]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 30 Jun 2019 23:43:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-values-from-search-into-subsearch/m-p/449260#M127224</guid>
      <dc:creator>nvanderwalt_spl</dc:creator>
      <dc:date>2019-06-30T23:43:40Z</dc:date>
    </item>
  </channel>
</rss>

