<?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: sort by Time desc in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93928#M24179</link>
    <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jul 2012 20:21:38 GMT</pubDate>
    <dc:creator>shangshin</dc:creator>
    <dc:date>2012-07-09T20:21:38Z</dc:date>
    <item>
      <title>sort by Time desc</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93926#M24177</link>
      <description>&lt;P&gt;Hi, I tried to format the eventtime and would like to show the latest time event first. However, the search string below always displays the oldest event first, What's even weird is that when I clicked on the Time header in the table, the column is still not sorted. I am wondering if anyone can shed some light on this?  Thank you!&lt;/P&gt;

&lt;P&gt;| bucket _time span=60m | eval Time=strftime(_time, "%m/%d %H:%M %Z") | STATS avg(time_taken) AS AverageResponseTime BY Time | sort by Time desc&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:02:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93926#M24177</guid>
      <dc:creator>shangshin</dc:creator>
      <dc:date>2020-09-28T12:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: sort by Time desc</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93927#M24178</link>
      <description>&lt;P&gt;Your syntax is a little off. Have a look at sort's syntax here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Sort"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Sort&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This should work better:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | sort - Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Jul 2012 19:51:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93927#M24178</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-07-09T19:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: sort by Time desc</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93928#M24179</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jul 2012 20:21:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93928#M24179</guid>
      <dc:creator>shangshin</dc:creator>
      <dc:date>2012-07-09T20:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: sort by Time desc</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93929#M24180</link>
      <description>&lt;P&gt;Hello, it doesn't seems to work for me &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
The source type is log4j logs. Splunk (light) successfully parsed date/time and shows me separate column in search results with name "Time". I tried (with space and without space after minus):&lt;BR /&gt;
| sort -Time&lt;BR /&gt;
| sort -_time&lt;/P&gt;

&lt;P&gt;Whatever I do it just ignore and sort results ascending.&lt;BR /&gt;
I figured out that if I put wrong field name it does the same. The name "_time" I tried to use because when you click on the value in Time column it shows option to show events before or auto and tell me that the field name is "_time". Could you make any suggestion please?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:17:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93929#M24180</guid>
      <dc:creator>dmorozov</dc:creator>
      <dc:date>2020-09-29T08:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: sort by Time desc</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93930#M24181</link>
      <description>&lt;P&gt;If you are trying to sort by the extracted timestamp, then _time is what you want to use i.e.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| sort -_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I just hit this and it was driving me nuts as I was using Time and not seeing the expected result.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 21:09:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93930#M24181</guid>
      <dc:creator>gblock_splunk</dc:creator>
      <dc:date>2016-06-28T21:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: sort by Time desc</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93931#M24182</link>
      <description>&lt;P&gt;Hi there, this answer isn't working for me. Here's the query I'm typing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;name@email.com | sort - Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And in the output I'm seeing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time
5/2/19 7:38:41.000 PM
5/2/19 7:38:44.769 PM
5/2/19 7:38:44.000 PM
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, not only is the order not &lt;EM&gt;descending&lt;/EM&gt;, but it's not even &lt;EM&gt;sorted&lt;/EM&gt;. Splunk is ignoring my sort directive altogether and is just doing whatever it wants instead.&lt;/P&gt;

&lt;P&gt;Please advise?&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 17:55:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-by-Time-desc/m-p/93931#M24182</guid>
      <dc:creator>evanriegel</dc:creator>
      <dc:date>2019-05-02T17:55:13Z</dc:date>
    </item>
  </channel>
</rss>

