<?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: Date sorting in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Date-sorting/m-p/528208#M149135</link>
    <description>&lt;P&gt;How exactly are you using the strptime function?&lt;/P&gt;&lt;P&gt;Sorting dates accurately into chronological order requires that they be converted into integer form.&amp;nbsp; Otherwise, the dates are sorted lexicographically.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | eval sortby = strptime (Date, "%b %Y")
| sort + sortby
| fields - sortby
| table ...&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 05 Nov 2020 20:07:32 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-11-05T20:07:32Z</dc:date>
    <item>
      <title>Date sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Date-sorting/m-p/528200#M149131</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have below data:&lt;/P&gt;
&lt;P&gt;Date:&lt;/P&gt;
&lt;P&gt;Sep 2020&lt;/P&gt;
&lt;P&gt;Aug 2018&lt;/P&gt;
&lt;P&gt;Feb 2020&lt;/P&gt;
&lt;P&gt;July 2017&lt;/P&gt;
&lt;P&gt;Sep 2019&lt;/P&gt;
&lt;P&gt;I want to sort the date by month and year&lt;/P&gt;
&lt;P&gt;Like July 2017&lt;/P&gt;
&lt;P&gt;Aug 2018&lt;/P&gt;
&lt;P&gt;Sep 2019&lt;/P&gt;
&lt;P&gt;Feb 2020&lt;/P&gt;
&lt;P&gt;Sep 2020&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using eval strftime function but ouput is coming as&lt;/P&gt;
&lt;P&gt;Sep 2020&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sep 2019&lt;/P&gt;
&lt;P&gt;Can someone please help me to fix this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 19:18:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Date-sorting/m-p/528200#M149131</guid>
      <dc:creator>ND</dc:creator>
      <dc:date>2020-11-05T19:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Date-sorting/m-p/528205#M149132</link>
      <description>&lt;P&gt;You need to parse the dates with strptime to get the equivalent epoch dates - this is a number. When you sort by this number the dates will be in the right order. You then convert them back to string format using strftime. If you do that with fieldformat, you don't change then value of the epoch date field, you just change how it is displayed. This may give you what you want.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 19:57:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Date-sorting/m-p/528205#M149132</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-11-05T19:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Date sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Date-sorting/m-p/528208#M149135</link>
      <description>&lt;P&gt;How exactly are you using the strptime function?&lt;/P&gt;&lt;P&gt;Sorting dates accurately into chronological order requires that they be converted into integer form.&amp;nbsp; Otherwise, the dates are sorted lexicographically.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | eval sortby = strptime (Date, "%b %Y")
| sort + sortby
| fields - sortby
| table ...&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Nov 2020 20:07:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Date-sorting/m-p/528208#M149135</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-11-05T20:07:32Z</dc:date>
    </item>
  </channel>
</rss>

