<?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: Sorting Date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118804#M31794</link>
    <description>&lt;P&gt;No &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; .....&lt;/P&gt;</description>
    <pubDate>Thu, 03 Apr 2014 14:08:57 GMT</pubDate>
    <dc:creator>dsmeerkat</dc:creator>
    <dc:date>2014-04-03T14:08:57Z</dc:date>
    <item>
      <title>Sorting Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118796#M31786</link>
      <description>&lt;P&gt;Okay so I missing something...&lt;/P&gt;

&lt;P&gt;Here's my searches:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*license_usage.log type=Usage | eval GB=b/1024/1024/1024 | timechart span=1d sum(GB) by pool useother=false | fieldformat Total=round(Total, 2) |rename auto_generated_pool_enterprise AS Total | tscollect namespace=License_Daily_Usage_7d keepresults=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;AND&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats sum(GB) AS Total, values(Total), values(Date) FROM License_Daily_Usage_7d groupby Date |  rename values(Total) AS Total_GB | convert timeformat="%a,  %m/%d/%y" ctime(_time) AS Date | sort _time | fields - _time | table Date, Total_GB 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And when the show up in the dashboard they are not being sorted by "Date" correctly...its doing:&lt;/P&gt;

&lt;P&gt;Fri, 03/28/14                                          943.270143&lt;BR /&gt;&lt;BR /&gt;
Mon, 03/31/14                                          900.663402&lt;BR /&gt;&lt;BR /&gt;
Sat, 03/29/14                                          836.616432&lt;BR /&gt;&lt;BR /&gt;
Sun, 03/30/14                                          779.676332&lt;BR /&gt;&lt;BR /&gt;
Thu, 03/27/14                                          487.159979&lt;BR /&gt;&lt;BR /&gt;
Thu, 04/03/14                                          514.808743&lt;BR /&gt;&lt;BR /&gt;
Tue, 04/01/14                                          965.568267&lt;BR /&gt;&lt;BR /&gt;
Wed, 04/02/14                                          1031.553619  &lt;/P&gt;

&lt;P&gt;I've tried sorting by everything I can think of and it just won't sort by %m/%d/%y &lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 13:28:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118796#M31786</guid>
      <dc:creator>dsmeerkat</dc:creator>
      <dc:date>2014-04-03T13:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118797#M31787</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
Add a dummy column and do the sort and hide it&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats sum(GB) AS Total, values(Total), values(Date) FROM License_Daily_Usage_7d groupby Date |  rename values(Total) AS Total_GB |convert timeformat="%a,  %m/%d/%y" ctime(_time) AS Date|eval a=strptime(Date,"%a,  %m/%d/%y") | table Date, Total_GB,a| sort a | fields - a 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 13:43:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118797#M31787</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-04-03T13:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118798#M31788</link>
      <description>&lt;P&gt;You second search (tstats) is not retrieving field _time.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 13:46:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118798#M31788</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-04-03T13:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118799#M31789</link>
      <description>&lt;P&gt;Thanks for the response but its still not working....&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 13:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118799#M31789</guid>
      <dc:creator>dsmeerkat</dc:creator>
      <dc:date>2014-04-03T13:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118800#M31790</link>
      <description>&lt;P&gt;Thanks for the response but its still not working....&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 13:50:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118800#M31790</guid>
      <dc:creator>dsmeerkat</dc:creator>
      <dc:date>2014-04-03T13:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118801#M31791</link>
      <description>&lt;P&gt;Try now, i didn't include the field in table column. This happens due to the date field not being actual date field rather a string..&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 13:51:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118801#M31791</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-04-03T13:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118802#M31792</link>
      <description>&lt;P&gt;Still no luck &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 13:59:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118802#M31792</guid>
      <dc:creator>dsmeerkat</dc:creator>
      <dc:date>2014-04-03T13:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118803#M31793</link>
      <description>&lt;P&gt;if you keep the field _time, does it sort?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 14:07:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118803#M31793</guid>
      <dc:creator>aelliott</dc:creator>
      <dc:date>2014-04-03T14:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118804#M31794</link>
      <description>&lt;P&gt;No &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; .....&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 14:08:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118804#M31794</guid>
      <dc:creator>dsmeerkat</dc:creator>
      <dc:date>2014-04-03T14:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118805#M31795</link>
      <description>&lt;P&gt;try &lt;/P&gt;

&lt;P&gt;|eval MyDate=strptime(Date,"%a,  %m/%d/%y") | sort MyDate | table MyDate, Total_GB&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 14:12:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118805#M31795</guid>
      <dc:creator>aelliott</dc:creator>
      <dc:date>2014-04-03T14:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118806#M31796</link>
      <description>&lt;P&gt;Okay now check the edited one?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 14:13:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118806#M31796</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-04-03T14:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118807#M31797</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*license_usage.log type=Usage | eval GB=b/1024/1024/1024 | timechart span=1d sum(GB) by pool useother=false |convert ctime(_time) AS Time | tscollect namespace=License_Daily_Usage_7d keepresults=true


| tstats sum(GB) AS Total, values(Total), values(Date) FROM License_Daily_Usage_7d groupby Date |  rename values(Total) AS Total_GB | convert timeformat="%a,  %m/%d/%y" ctime(_time) AS Date | sort _time | fields - _time | eval MyDate=strptime(Date,"%a, %m/%d/%y") | sort MyDate | convert timeformat="%a,  %m/%d/%y" ctime(_time) AS Date| table Date, Total_GB
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Works like a charm!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 16:05:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sorting-Date/m-p/118807#M31797</guid>
      <dc:creator>dsmeerkat</dc:creator>
      <dc:date>2014-04-03T16:05:44Z</dc:date>
    </item>
  </channel>
</rss>

