<?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 get earliest and latest from time filter? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501105#M85360</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;index=my_index
| addinfo | rename info_* AS _info_*
earliest=$results._info_min_time$
latest=$results._info_max_time$
"Log Message"
| timechart count by sourcetype limit=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this is what i am using after change from &lt;STRONG&gt;$duration.earliest$&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;$duration.latest$&lt;/STRONG&gt;  to the above query, chart gets stuck at waiting for input even when i select some time in my time query.&lt;/P&gt;

&lt;P&gt;@woodcock  Can you please let me know what I am doing wrong here ?&lt;/P&gt;</description>
    <pubDate>Fri, 11 Oct 2019 21:44:36 GMT</pubDate>
    <dc:creator>asubramanian</dc:creator>
    <dc:date>2019-10-11T21:44:36Z</dc:date>
    <item>
      <title>How to get earliest and latest from time filter?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501103#M85358</link>
      <description>&lt;P&gt;I am using a dashboard with some filters including the built int time input for the events.&lt;/P&gt;

&lt;P&gt;For the queries in the chart Iam using &lt;STRONG&gt;$duration.earliest$&lt;/STRONG&gt; and &lt;STRONG&gt;$duration.latest$&lt;/STRONG&gt; for earliest and latest window.&lt;/P&gt;

&lt;P&gt;below is a sample query in the dashboard and how I am fetching the time from the time input filter.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index
 earliest=$duration.earliest$
 latest=$duration.latest$
 "Log Message"
 | timechart count by sourcetype limit=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works for the preset for relative duration like last 7 days, 30 days etc but when I click All time it doesnt work. Looking at the query both this are set to empty values. &lt;/P&gt;

&lt;P&gt;For all time shouldn't the evaluated values be set as  &lt;STRONG&gt;earliest=1 latest=now&lt;/STRONG&gt; ?&lt;/P&gt;

&lt;P&gt;Similar error when I use realtime when I use real time of 10 day window the query becomes&lt;BR /&gt;
&lt;STRONG&gt;earliest=rt-10d latest=rtnow&lt;/STRONG&gt; and errors out as " Invalid value "rt-10d" for time term 'earliest'"&lt;/P&gt;

&lt;P&gt;Edit: if search is not enabled in the times.conf does it return this error ? &lt;/P&gt;

&lt;P&gt;Rest of Presets, relative and time range works without these issues.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 19:14:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501103#M85358</guid>
      <dc:creator>asubramanian</dc:creator>
      <dc:date>2019-10-11T19:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get earliest and latest from time filter?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501104#M85359</link>
      <description>&lt;P&gt;Add this to your SPL:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | addinfo | rename info_* AS _info_*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then use &lt;CODE&gt;$results._info_min_time$&lt;/CODE&gt; and &lt;CODE&gt;$results._info_max_time&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 19:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501104#M85359</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-10-11T19:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get earliest and latest from time filter?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501105#M85360</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=my_index
| addinfo | rename info_* AS _info_*
earliest=$results._info_min_time$
latest=$results._info_max_time$
"Log Message"
| timechart count by sourcetype limit=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this is what i am using after change from &lt;STRONG&gt;$duration.earliest$&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;$duration.latest$&lt;/STRONG&gt;  to the above query, chart gets stuck at waiting for input even when i select some time in my time query.&lt;/P&gt;

&lt;P&gt;@woodcock  Can you please let me know what I am doing wrong here ?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 21:44:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501105#M85360</guid>
      <dc:creator>asubramanian</dc:creator>
      <dc:date>2019-10-11T21:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to get earliest and latest from time filter?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501106#M85361</link>
      <description>&lt;P&gt;Also &lt;STRONG&gt;info_min_time&lt;/STRONG&gt; and &lt;STRONG&gt;info_max_time&lt;/STRONG&gt; both seem to be fixed values and not configurable from the time search input i.e info_max_time is always infinity and info_min_time is always 0&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:31:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501106#M85361</guid>
      <dc:creator>asubramanian</dc:creator>
      <dc:date>2020-09-30T02:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get earliest and latest from time filter?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501107#M85362</link>
      <description>&lt;P&gt;I thought that you were talking about dashboards and simplexml.  You are going to have to back ALL THE WAY UP and explain exactly what you are doing.  It makes no sense at all to me why you would need to do any of this and not just rely on the timepicker's natural behaviour.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2019 17:44:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501107#M85362</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-10-12T17:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to get earliest and latest from time filter?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501108#M85363</link>
      <description>&lt;P&gt;@woodcock  I am using the time picker. as I mentioned earlier. I have shared the sample query on how I am getting the value from the time picker in my queries. for 'All' and relative times this doesnt work. &lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 19:36:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501108#M85363</guid>
      <dc:creator>asubramanian</dc:creator>
      <dc:date>2019-10-15T19:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get earliest and latest from time filter?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501109#M85364</link>
      <description>&lt;P&gt;You are doing it wrong.  Your dashboard panel should look like this (you can see that the time token values are in the &lt;CODE&gt;&amp;lt;earliest&amp;gt;$field1.earliest$&amp;lt;/earliest&amp;gt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;lt;latest&amp;gt;$field1.latest$&amp;lt;/latest&amp;gt;&lt;/CODE&gt; XML specifiers, NOT in the &lt;CODE&gt;SPL&lt;/CODE&gt;!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Demo Solution&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="time" token="field1"&amp;gt;
      &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=my_index AND "Log Message" | timechart limit=0 count BY sourcetype&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$field1.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$field1.latest$&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;pie&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Check the &lt;CODE&gt;Dashboard Examples&lt;/CODE&gt; app.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 20:35:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501109#M85364</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-10-16T20:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get earliest and latest from time filter?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501110#M85365</link>
      <description>&lt;P&gt;Thanks a lot @woodcock passing the filter to   tags instead of filter in query language worked.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 23:18:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-get-earliest-and-latest-from-time-filter/m-p/501110#M85365</guid>
      <dc:creator>asubramanian</dc:creator>
      <dc:date>2019-10-16T23:18:38Z</dc:date>
    </item>
  </channel>
</rss>

