<?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: why stats last and first are inverted ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90181#M23145</link>
    <description>&lt;P&gt;see &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.1/SearchReference/CommonStatsFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.1/SearchReference/CommonStatsFunctions&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2014 22:01:51 GMT</pubDate>
    <dc:creator>yannK</dc:creator>
    <dc:date>2014-02-18T22:01:51Z</dc:date>
    <item>
      <title>why stats last and first are inverted ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90174#M23138</link>
      <description>&lt;P&gt;When I search with stats first(myfield) last(myfield)&lt;BR /&gt;
They return the opposite  !!!!&lt;/P&gt;

&lt;P&gt;example :&lt;BR /&gt;
10/10/2010 myfield=A&lt;BR /&gt;
12/12/2012 myfield=B&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;| stats first(myfield) last(myfield)
returns first=B, last=A&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 13 Mar 2012 01:35:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90174#M23138</guid>
      <dc:creator>mataharry</dc:creator>
      <dc:date>2012-03-13T01:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: why stats last and first are inverted ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90175#M23139</link>
      <description>&lt;P&gt;Splunk starts to search events at the current time, and progressively search backward in the past.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;first() returns the first seen result -&amp;gt; the most recent reference &lt;/LI&gt;
&lt;LI&gt;last() returns the last seen result - &amp;gt; the oldest reference &lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Please read the documentation with attention :&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.1/SearchReference/CommonStatsFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.1/SearchReference/CommonStatsFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2012 01:36:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90175#M23139</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-03-13T01:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: why stats last and first are inverted ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90176#M23140</link>
      <description>&lt;P&gt;This is so crazy, why using so confusing names !&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2012 01:37:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90176#M23140</guid>
      <dc:creator>mataharry</dc:creator>
      <dc:date>2012-03-13T01:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: why stats last and first are inverted ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90177#M23141</link>
      <description>&lt;P&gt;Note that&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;earliest&lt;/LI&gt;
&lt;LI&gt;latest&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;also exist which have the meanings that you seem to be looking for from first and last. &lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2012 01:57:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90177#M23141</guid>
      <dc:creator>willthames2</dc:creator>
      <dc:date>2012-03-13T01:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: why stats last and first are inverted ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90178#M23142</link>
      <description>&lt;P&gt;Splunk is a reverse time-series index, so while it might be confusing, it is techically correct.  The results of a Splunk search are ordered by default from most recent to least recent.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2012 04:46:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90178#M23142</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-03-13T04:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: why stats last and first are inverted ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90179#M23143</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;does it make a difference, how the events are sorted? So, is "last seen" independent of the order of the events and does always mean "the earliest timestamp"?&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;

&lt;P&gt;Heinz&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 17:15:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90179#M23143</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2013-11-01T17:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: why stats last and first are inverted ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90180#M23144</link>
      <description>&lt;P&gt;Yes it matters how events are sorted for the &lt;CODE&gt;first&lt;/CODE&gt; and &lt;CODE&gt;last&lt;/CODE&gt; functions. However, the sort order does not matter for the &lt;CODE&gt;earliest&lt;/CODE&gt; and &lt;CODE&gt;latest&lt;/CODE&gt; functions, as they are based on the event timestamp.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2013 18:19:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90180#M23144</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-11-04T18:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: why stats last and first are inverted ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90181#M23145</link>
      <description>&lt;P&gt;see &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.1/SearchReference/CommonStatsFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.1/SearchReference/CommonStatsFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 22:01:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90181#M23145</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2014-02-18T22:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: why stats last and first are inverted ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90182#M23146</link>
      <description>&lt;P&gt;Hi, I have then a situation that is confusing me.&lt;BR /&gt;
I use last to store the first occurrence of an event, then I store that in a lookup file. &lt;BR /&gt;
Next thing I do is to do a sub search for the last 24h get the first occurrence and append that to the lookup file. &lt;BR /&gt;
at that point I need to remove duplicates and keep only the very last in the lookup file. &lt;/P&gt;

&lt;P&gt;Does that convention also works when you are not looking up at the stored data events but in a lookup file???&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;/P&gt;

&lt;P&gt;Rgds,&lt;BR /&gt;
Juan&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 13:23:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-stats-last-and-first-are-inverted/m-p/90182#M23146</guid>
      <dc:creator>jperezes</dc:creator>
      <dc:date>2016-04-05T13:23:26Z</dc:date>
    </item>
  </channel>
</rss>

