<?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: latest function in stats not working without earliest? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85134#M21719</link>
    <description>&lt;P&gt;Is this supposed to be fixed in 5.0.1? We are having the same issue...what is the workaround? &lt;/P&gt;</description>
    <pubDate>Tue, 26 Mar 2013 20:43:50 GMT</pubDate>
    <dc:creator>srowe</dc:creator>
    <dc:date>2013-03-26T20:43:50Z</dc:date>
    <item>
      <title>latest function in stats not working without earliest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85128#M21713</link>
      <description>&lt;P&gt;Given the events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2012-03-06 01:02:00 a=1 b=2
2012-03-06 02:03:00 a=2 b=3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and the query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count latest(a) by b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;latest(a) is empty. However, if you add earliest(a) to the query, like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count latest(a) earliest(a) by b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;then both latest(a) and earliest(a) are populated. earliest also works by itself.&lt;/P&gt;

&lt;P&gt;Any idea why latest won't work by itself?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2012 04:11:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85128#M21713</guid>
      <dc:creator>vbumgarn</dc:creator>
      <dc:date>2012-03-06T04:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: latest function in stats not working without earliest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85129#M21714</link>
      <description>&lt;P&gt;Thanks for posting this question.  I was frustrated about last() working but then latest() had no results.  I added earliest() and for some reason latest() worked.  It looks like a bug to me. &lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2012 21:16:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85129#M21714</guid>
      <dc:creator>rmonge</dc:creator>
      <dc:date>2012-03-26T21:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: latest function in stats not working without earliest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85130#M21715</link>
      <description>&lt;P&gt;nice catch. I'd been having the hardest time figuring out why latest only worked sometimes, I just started to use first. Seems like a bug to me!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Apr 2012 20:59:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85130#M21715</guid>
      <dc:creator>bmgilmore</dc:creator>
      <dc:date>2012-04-02T20:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: latest function in stats not working without earliest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85131#M21716</link>
      <description>&lt;P&gt;I filed this as SPL-50131 and I will do my best to update as I have more information.&lt;/P&gt;

&lt;P&gt;In the meantime, use the workaround here:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/45268/stats-latest-not-returning-a-value/45276"&gt;http://splunk-base.splunk.com/answers/45268/stats-latest-not-returning-a-value/45276&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2012 17:13:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85131#M21716</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-04-11T17:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: latest function in stats not working without earliest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85132#M21717</link>
      <description>&lt;P&gt;Still broken in 4.3.2. Any idea on when a fix will be in?&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2012 19:28:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85132#M21717</guid>
      <dc:creator>vbumgarn</dc:creator>
      <dc:date>2012-05-04T19:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: latest function in stats not working without earliest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85133#M21718</link>
      <description>&lt;P&gt;It was always to late for 4.3.2, so I would hope 4.3.3.&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2012 16:49:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85133#M21718</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-05-06T16:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: latest function in stats not working without earliest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85134#M21719</link>
      <description>&lt;P&gt;Is this supposed to be fixed in 5.0.1? We are having the same issue...what is the workaround? &lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2013 20:43:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85134#M21719</guid>
      <dc:creator>srowe</dc:creator>
      <dc:date>2013-03-26T20:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: latest function in stats not working without earliest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85135#M21720</link>
      <description>&lt;P&gt;According to SPL-50131 this was fixed in 4.3.3 and also should be fixed in 5.0.0 through 5.0.2.  If this isn't the case, please file a support ticket so we can get the required information from you.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2013 20:47:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85135#M21720</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2013-03-26T20:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: latest function in stats not working without earliest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85136#M21721</link>
      <description>&lt;P&gt;I am having the same problem in 6.0.1.  Sometimes the latest result is returned, sometimes it is blank.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2014 22:24:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85136#M21721</guid>
      <dc:creator>caseypike</dc:creator>
      <dc:date>2014-04-11T22:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: latest function in stats not working without earliest?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85137#M21722</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;See that stats command need _time field to get latest so if you have query like&lt;BR /&gt;
index=xyz | tabel t1, t2,t3 | stats latest(t1) by t2,t3&lt;/P&gt;

&lt;P&gt;then you will see blank for latest(t1) column&lt;/P&gt;

&lt;P&gt;change query like&lt;BR /&gt;
index=xyz | tabel t1, t2, t3,_time | stats latest(t1) by t2,t3 | fields - _time&lt;BR /&gt;
OR&lt;BR /&gt;
index=xyz | stats latest(t1) by t2,t3&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 06:56:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/latest-function-in-stats-not-working-without-earliest/m-p/85137#M21722</guid>
      <dc:creator>shreyans</dc:creator>
      <dc:date>2015-07-13T06:56:56Z</dc:date>
    </item>
  </channel>
</rss>

