<?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 is the TAIL command listing the events in order of ascending time while the HEAD command lists the events in order of descending time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-TAIL-command-listing-the-events-in-order-of-ascending/m-p/330248#M98308</link>
    <description>&lt;P&gt;Because that how the commands are written. The documentation for &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Tail"&gt;tail&lt;/A&gt; says " events are returned in reverse order, starting at the end of the result set..." The documentation for &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Head"&gt;head&lt;/A&gt; says "Returns the first N number of specified results in search order"&lt;/P&gt;

&lt;P&gt;If you want the results in a different order, follow the command with "| reverse"&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2017 00:11:50 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2017-02-28T00:11:50Z</dc:date>
    <item>
      <title>Why is the TAIL command listing the events in order of ascending time while the HEAD command lists the events in order of descending time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-TAIL-command-listing-the-events-in-order-of-ascending/m-p/330247#M98307</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I ran a search that had 15,000+ events. The table had the same amount of results. The results were listed in reverse chronological order for the most part.&lt;/P&gt;

&lt;P&gt;I wanted to see the last 10 results. So I used the TAIL command. But the last 10 results were in chronological order. It was counter intuitive to me because I thought it would be similar to scrolling down to the bottom of the original list. I was expecting the last 10 results to be in reverse chronological order.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval myTime=_time
| eval myTime2=strftime(myTime,"%Y-%m-%d %H:%M:%S:%3Q")
| bucket SPAN=5m _time
| tail 
| table _time myTime myTime2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;_time ----------------------------------- myTime    ---------------- myTime2&lt;BR /&gt;
2012-03-16T12:30:00.000+0000    1331901000.000000   2012-03-16 12:30:00:000&lt;BR /&gt;
2012-03-16T12:30:00.000+0000    1331901000.000000   2012-03-16 12:30:00:000&lt;BR /&gt;
2012-03-16T12:30:00.000+0000    1331901000.000000   2012-03-16 12:30:00:000&lt;BR /&gt;
2012-03-16T12:30:00.000+0000    1331901000.000000   2012-03-16 12:30:00:000&lt;BR /&gt;
2012-03-16T12:30:00.000+0000    1331901000.000000   2012-03-16 12:30:00:000&lt;BR /&gt;
2012-03-16T12:30:00.000+0000    1331901000.010000   2012-03-16 12:30:00:010&lt;BR /&gt;
2012-03-16T12:30:00.000+0000    1331901000.020000   2012-03-16 12:30:00:020&lt;BR /&gt;
2012-03-16T12:30:00.000+0000    1331901000.020000   2012-03-16 12:30:00:020&lt;BR /&gt;
2012-03-16T12:30:00.000+0000    1331901000.030000   2012-03-16 12:30:00:030&lt;BR /&gt;
2012-03-16T12:30:00.000+0000    1331901000.040000   2012-03-16 12:30:00:040&lt;/P&gt;

&lt;P&gt;I then ran the HEAD command to see if that would also change the order. But it did not. The HEAD command put the first 10 events in reverse chronological order as expected.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval myTime=_time
| eval myTime2=strftime(myTime,"%Y-%m-%d %H:%M:%S:%3Q")
| bucket SPAN=5m _time
| head 
| table _time myTime myTime2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;_time ----------------------------------- myTime    ---------------- myTime2&lt;BR /&gt;
2012-03-16T13:25:00.000+0000    1331904442.350000   2012-03-16 13:27:22:350&lt;BR /&gt;
2012-03-16T13:25:00.000+0000    1331904442.220000   2012-03-16 13:27:22:220&lt;BR /&gt;
2012-03-16T13:25:00.000+0000    1331904442.100000   2012-03-16 13:27:22:100&lt;BR /&gt;
2012-03-16T13:25:00.000+0000    1331904442.090000   2012-03-16 13:27:22:090&lt;BR /&gt;
2012-03-16T13:25:00.000+0000    1331904442.000000   2012-03-16 13:27:22:000&lt;BR /&gt;
2012-03-16T13:25:00.000+0000    1331904442.000000   2012-03-16 13:27:22:000&lt;BR /&gt;
2012-03-16T13:25:00.000+0000    1331904442.000000   2012-03-16 13:27:22:000&lt;BR /&gt;
2012-03-16T13:25:00.000+0000    1331904442.000000   2012-03-16 13:27:22:000&lt;BR /&gt;
2012-03-16T13:25:00.000+0000    1331904441.960000   2012-03-16 13:27:21:960&lt;BR /&gt;
2012-03-16T13:25:00.000+0000    1331904441.950000   2012-03-16 13:27:21:950&lt;/P&gt;

&lt;P&gt;Why is the TAIL command listing the events in order of ascending time while the HEAD command lists the events in order of descending time?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 22:30:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-TAIL-command-listing-the-events-in-order-of-ascending/m-p/330247#M98307</guid>
      <dc:creator>kdwsplunk</dc:creator>
      <dc:date>2017-02-27T22:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the TAIL command listing the events in order of ascending time while the HEAD command lists the events in order of descending time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-TAIL-command-listing-the-events-in-order-of-ascending/m-p/330248#M98308</link>
      <description>&lt;P&gt;Because that how the commands are written. The documentation for &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Tail"&gt;tail&lt;/A&gt; says " events are returned in reverse order, starting at the end of the result set..." The documentation for &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Head"&gt;head&lt;/A&gt; says "Returns the first N number of specified results in search order"&lt;/P&gt;

&lt;P&gt;If you want the results in a different order, follow the command with "| reverse"&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 00:11:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-TAIL-command-listing-the-events-in-order-of-ascending/m-p/330248#M98308</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2017-02-28T00:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the TAIL command listing the events in order of ascending time while the HEAD command lists the events in order of descending time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-TAIL-command-listing-the-events-in-order-of-ascending/m-p/330249#M98309</link>
      <description>&lt;P&gt;Thank you very much for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 00:23:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-TAIL-command-listing-the-events-in-order-of-ascending/m-p/330249#M98309</guid>
      <dc:creator>kdwsplunk</dc:creator>
      <dc:date>2017-02-28T00:23:51Z</dc:date>
    </item>
  </channel>
</rss>

