<?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 variable time search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/variable-time-search/m-p/25990#M4966</link>
    <description>&lt;P&gt;Hi, I am trying to search a query where I need a _time value from sub search to the main search and in main search earliest should be the _time which I get from the sub search. I tried to give it as a variable but it dint work.&lt;/P&gt;

&lt;P&gt;sourcetype=dg earliest=_time [search earliest=-7d sourcetype=dg (src_file_name="usb#&lt;EM&gt;flash disk&lt;/EM&gt;" OR src_file_name="usb#&lt;EM&gt;mass storage&lt;/EM&gt;") | dedup src_host, src_file_name | return src_host, _time]&lt;/P&gt;

&lt;P&gt;I also tried the below query but it dint work&lt;/P&gt;

&lt;P&gt;sourcetype=dg earliest=$_time [search earliest=-7d sourcetype=dg (src_file_name="usb#&lt;EM&gt;flash disk&lt;/EM&gt;" OR src_file_name="usb#&lt;EM&gt;mass storage&lt;/EM&gt;") | dedup src_host, src_file_name | return src_host, $_time]&lt;/P&gt;

&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 12:45:23 GMT</pubDate>
    <dc:creator>kvmanjunath</dc:creator>
    <dc:date>2020-09-28T12:45:23Z</dc:date>
    <item>
      <title>variable time search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/variable-time-search/m-p/25990#M4966</link>
      <description>&lt;P&gt;Hi, I am trying to search a query where I need a _time value from sub search to the main search and in main search earliest should be the _time which I get from the sub search. I tried to give it as a variable but it dint work.&lt;/P&gt;

&lt;P&gt;sourcetype=dg earliest=_time [search earliest=-7d sourcetype=dg (src_file_name="usb#&lt;EM&gt;flash disk&lt;/EM&gt;" OR src_file_name="usb#&lt;EM&gt;mass storage&lt;/EM&gt;") | dedup src_host, src_file_name | return src_host, _time]&lt;/P&gt;

&lt;P&gt;I also tried the below query but it dint work&lt;/P&gt;

&lt;P&gt;sourcetype=dg earliest=$_time [search earliest=-7d sourcetype=dg (src_file_name="usb#&lt;EM&gt;flash disk&lt;/EM&gt;" OR src_file_name="usb#&lt;EM&gt;mass storage&lt;/EM&gt;") | dedup src_host, src_file_name | return src_host, $_time]&lt;/P&gt;

&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:45:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/variable-time-search/m-p/25990#M4966</guid>
      <dc:creator>kvmanjunath</dc:creator>
      <dc:date>2020-09-28T12:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: variable time search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/variable-time-search/m-p/25991#M4967</link>
      <description>&lt;P&gt;The problem here is that &lt;CODE&gt;_time&lt;/CODE&gt; is considered an internal field and as such will not be returned by the subsearch. I wrote about a way to work around this in another answer, available here: &lt;A href="http://splunk-base.splunk.com/answers/52891/most-recent-event-from-each-source"&gt;http://splunk-base.splunk.com/answers/52891/most-recent-event-from-each-source&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2012 10:03:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/variable-time-search/m-p/25991#M4967</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-11-07T10:03:17Z</dc:date>
    </item>
  </channel>
</rss>

