<?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: Pass time value into another search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171245#M49036</link>
    <description>&lt;P&gt;Edited. However, seconds are not the problem. The fact that the search will not run is the focus.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Oct 2014 16:12:22 GMT</pubDate>
    <dc:creator>bigrichie90</dc:creator>
    <dc:date>2014-10-22T16:12:22Z</dc:date>
    <item>
      <title>Pass time value into another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171243#M49034</link>
      <description>&lt;P&gt;I have this query in which I join with another query. I want to take the earliest event of the first query, go back a certain amount of time (days, let's say a day = 86400 seconds) and plug that value into the earliest function in the second query. I have tried reformatting the time as stated in the docs and I keep getting a "Invalid value &lt;EM&gt;start&lt;/EM&gt; for time term &lt;EM&gt;earliest&lt;/EM&gt;". Is there a way, or a simpler way, of doing this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source1 | stats earliest(_time) AS start | eval start=start-86400 | eval start=strftime(start, "%m/%d/%Y :%H:%M:%S") | eval event=_time | . . . | join dest_ip [search source2  _time&amp;lt;event **earliest=start** | . . .| dedup dest_ip sortby -_time]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Oct 2014 15:33:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171243#M49034</guid>
      <dc:creator>bigrichie90</dc:creator>
      <dc:date>2014-10-22T15:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Pass time value into another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171244#M49035</link>
      <description>&lt;P&gt;A day is 86400 seconds.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 16:08:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171244#M49035</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2014-10-22T16:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Pass time value into another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171245#M49036</link>
      <description>&lt;P&gt;Edited. However, seconds are not the problem. The fact that the search will not run is the focus.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 16:12:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171245#M49036</guid>
      <dc:creator>bigrichie90</dc:creator>
      <dc:date>2014-10-22T16:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Pass time value into another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171246#M49037</link>
      <description>&lt;P&gt;I would approach this with a subsearch. The subsearch (when filtering) is evaluated first, and its results are passed to the outer search, similar to "here documents" in a shell. &lt;/P&gt;

&lt;P&gt;It looks to me like you want "find thing one, then go back up to a day and find thing two"? To make the search a bit easier, I'd actually turn the two around, maybe something like this.&lt;/P&gt;

&lt;PRE&gt;
source2  [ search source1 | stats earliest(_time) AS earliest, latest(_time) AS latest | eval earliest=earliest-86400 | return earliest, latest ]
| join dest_ip [ search source1 ... ]
| dedup dest_ip
| sort - _time
&lt;/PRE&gt;

&lt;P&gt;My thinking here is that the time range picker will apply to the subsearch in the join, but our time math will govern the time range of the search on source2.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 16:16:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171246#M49037</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2014-10-22T16:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Pass time value into another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171247#M49038</link>
      <description>&lt;P&gt;Yeah, no worries, I was just in process typing up the search idea.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 16:17:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171247#M49038</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2014-10-22T16:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Pass time value into another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171248#M49039</link>
      <description>&lt;P&gt;This seems to be closer to what I need. However, the reason source1 is the first query is so I can restrict source2's events to the ones that happened BEFORE each event in source1. Otherwise, current events from source1 will show up and distort the accuracy. (that's what the   _timeLESSTHANevent was for) ---Sorry weird formatting when using the less than symbol.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 16:23:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pass-time-value-into-another-search/m-p/171248#M49039</guid>
      <dc:creator>bigrichie90</dc:creator>
      <dc:date>2014-10-22T16:23:00Z</dc:date>
    </item>
  </channel>
</rss>

