<?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 field value for earliest and latest in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120805#M32460</link>
    <description>&lt;P&gt;It would seem to me you'd need to have a function there which would replace the literal characters "first" with the value. I've not seen this done, but could you do a subsearch in brackets there? i.e. search index=any earliest=[search terms | fields first]&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jun 2014 12:25:12 GMT</pubDate>
    <dc:creator>jeremiahc4</dc:creator>
    <dc:date>2014-06-26T12:25:12Z</dc:date>
    <item>
      <title>Use field value for earliest and latest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120803#M32458</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a field "first" with a value that looks like "%m/%d/%Y:%H:%M:%S". For Example 06/25/2014:0:0:0.&lt;BR /&gt;
Now I would like to use this field value for:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search index=any earliest=first...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gives me the exception that the string "first" is invalid for earliest.&lt;BR /&gt;
But if I use earliest = "06/25/2014:0:0:0" it works.&lt;BR /&gt;
How can i use the field value?&lt;BR /&gt;
Greetings &lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2014 11:53:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120803#M32458</guid>
      <dc:creator>C_Sparn</dc:creator>
      <dc:date>2014-06-26T11:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Use field value for earliest and latest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120804#M32459</link>
      <description>&lt;P&gt;Where does that field value come from?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2014 12:01:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120804#M32459</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-26T12:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Use field value for earliest and latest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120805#M32460</link>
      <description>&lt;P&gt;It would seem to me you'd need to have a function there which would replace the literal characters "first" with the value. I've not seen this done, but could you do a subsearch in brackets there? i.e. search index=any earliest=[search terms | fields first]&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2014 12:25:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120805#M32460</guid>
      <dc:creator>jeremiahc4</dc:creator>
      <dc:date>2014-06-26T12:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Use field value for earliest and latest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120806#M32461</link>
      <description>&lt;P&gt;Hello, &lt;BR /&gt;
I'm getting the value from a field with multiple date values like this:&lt;/P&gt;

&lt;P&gt;|stats first(other_field) as first  then I go on with&lt;BR /&gt;
|join[search... earliest = first]&lt;/P&gt;

&lt;P&gt;And earliest=[subsearch] is a good idea but is also not working.&lt;BR /&gt;
Greetings&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2014 12:49:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120806#M32461</guid>
      <dc:creator>C_Sparn</dc:creator>
      <dc:date>2014-06-26T12:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Use field value for earliest and latest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120807#M32462</link>
      <description>&lt;P&gt;You can pass subsearch results into &lt;CODE&gt;earliest&lt;/CODE&gt; and &lt;CODE&gt;latest&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal [stats count | eval earliest="-h@m" | fields earliest] [stats count | eval latest="now" | fields latest]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The two subsearches can be arbitrary searches that somehow compute the timerange.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2014 13:18:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120807#M32462</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-26T13:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Use field value for earliest and latest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120808#M32463</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;thank you, that is working. But you can also use &lt;/P&gt;

&lt;P&gt;search...earliest = [search subsearch |return $earliest]&lt;/P&gt;

&lt;P&gt;if earliest has the right time format.&lt;BR /&gt;
Greetings&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2014 14:11:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120808#M32463</guid>
      <dc:creator>C_Sparn</dc:creator>
      <dc:date>2014-06-26T14:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Use field value for earliest and latest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120809#M32464</link>
      <description>&lt;P&gt;Yeah - be wary of using that in dashboards though, you'll have to escape the dollar sign using a second dollar sign.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2014 15:54:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-field-value-for-earliest-and-latest/m-p/120809#M32464</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-26T15:54:00Z</dc:date>
    </item>
  </channel>
</rss>

