<?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: How to sort data in chronological order by month, not alphabetically? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142281#M39456</link>
    <description>&lt;P&gt;Thank you, it works&lt;/P&gt;</description>
    <pubDate>Fri, 26 Sep 2014 07:35:05 GMT</pubDate>
    <dc:creator>karthikTIL</dc:creator>
    <dc:date>2014-09-26T07:35:05Z</dc:date>
    <item>
      <title>How to sort data in chronological order by month, not alphabetically?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142279#M39454</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;

&lt;P&gt;For my below query, i get months in alphabetical order like april-2014, august-2014, february-2014, January-2014. &lt;/P&gt;

&lt;P&gt;But i want this to be sorted like  January-2014, February-2014. Please let me know.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="test.csv"| eval Month=date_month."-".date_year|stats count(Incidents) by Month
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Sep 2014 07:07:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142279#M39454</guid>
      <dc:creator>karthikTIL</dc:creator>
      <dc:date>2014-09-26T07:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data in chronological order by month, not alphabetically?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142280#M39455</link>
      <description>&lt;P&gt;Splunk has no idea that "January" corresponds to month "1" and "February" corresponds to month "2". You need to tell it. One simple way of doing that is creating a numerical field to sort by and use that:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=test.csv | strftime month_num=strftime(_time,"%m") | eval Month=date_month."-".date_year | stats count(Incidents) by month_num,Month | sort month_num | fields - month_num
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Sep 2014 07:22:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142280#M39455</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-09-26T07:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data in chronological order by month, not alphabetically?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142281#M39456</link>
      <description>&lt;P&gt;Thank you, it works&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2014 07:35:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142281#M39456</guid>
      <dc:creator>karthikTIL</dc:creator>
      <dc:date>2014-09-26T07:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data in chronological order by month, not alphabetically?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142282#M39457</link>
      <description>&lt;P&gt;I have a field Month which has values  as [Jan,Feb,Mar ....]. I tried the above solution but it didn't work for me. &lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 18:03:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142282#M39457</guid>
      <dc:creator>agoriawala_splu</dc:creator>
      <dc:date>2015-06-23T18:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data in chronological order by month, not alphabetically?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142283#M39458</link>
      <description>&lt;P&gt;I used the following for fiscal years.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval sort=case(
     Month=="AUG","01",
     Month=="SEP","02",
     Month=="OCT","03",
     Month=="NOV","04",
     Month=="DEC","05",
     Month=="JAN","06",
     Month=="FEB","07",
     Month=="MAR","08",
     Month=="APR","09",
     Month=="MAY","10",
     Month=="JUN","11",
     Month=="JUL","12")
| sort sort     
| fields - sort
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jun 2018 23:08:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142283#M39458</guid>
      <dc:creator>pbarbuto</dc:creator>
      <dc:date>2018-06-11T23:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data in chronological order by month, not alphabetically?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142284#M39459</link>
      <description>&lt;P&gt;The following converts the month into Y-m format and the numerical sorting helps out. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search |convert ctime(_time) as Time timeformat=%Y-%m|chart avg(yourfield) over Time by some_other_field|sort Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Sep 2018 05:18:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142284#M39459</guid>
      <dc:creator>sunilsk1</dc:creator>
      <dc:date>2018-09-29T05:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort data in chronological order by month, not alphabetically?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142285#M39460</link>
      <description>&lt;P&gt;You can use timechart (what do you want to correlate with months). In your case, if you want to know the Incidents per month, would be &lt;STRONG&gt;| timechart count by Incidents&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 16:57:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-data-in-chronological-order-by-month-not/m-p/142285#M39460</guid>
      <dc:creator>frsouza</dc:creator>
      <dc:date>2019-11-07T16:57:05Z</dc:date>
    </item>
  </channel>
</rss>

