<?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 isn't my search sorting events chronologically by month? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-my-search-sorting-events-chronologically-by-month/m-p/283718#M85747</link>
    <description>&lt;P&gt;I added the reverse command to your query and it worked exactly as I wanted it.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2016 19:29:16 GMT</pubDate>
    <dc:creator>Yaichael</dc:creator>
    <dc:date>2016-09-13T19:29:16Z</dc:date>
    <item>
      <title>Why isn't my search sorting events chronologically by month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-my-search-sorting-events-chronologically-by-month/m-p/283716#M85745</link>
      <description>&lt;P&gt;I'm executing the following search to generate a report with columns sorted chronologically by month:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( ... ) | eval month_num = strftime( _time ,"%m" ) | stats count by date_month | sort - month_num
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;date_month&lt;/STRONG&gt; = month field taken from the events' data&lt;/P&gt;

&lt;P&gt;Splunk can't still interpret the chronological order of the months.&lt;/P&gt;

&lt;P&gt;What am I missing?&lt;/P&gt;

&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 19:05:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-my-search-sorting-events-chronologically-by-month/m-p/283716#M85745</guid>
      <dc:creator>Yaichael</dc:creator>
      <dc:date>2016-09-13T19:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't my search sorting events chronologically by month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-my-search-sorting-events-chronologically-by-month/m-p/283717#M85746</link>
      <description>&lt;P&gt;There is no month_num field after stats, hence the sort fails. Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( ... ) | eval month_num = strftime( _time ,"%m" ) | stats count by date_month month_num | sort - month_num | fields - month_num
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Sep 2016 19:15:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-my-search-sorting-events-chronologically-by-month/m-p/283717#M85746</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-13T19:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't my search sorting events chronologically by month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-my-search-sorting-events-chronologically-by-month/m-p/283718#M85747</link>
      <description>&lt;P&gt;I added the reverse command to your query and it worked exactly as I wanted it.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 19:29:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-my-search-sorting-events-chronologically-by-month/m-p/283718#M85747</guid>
      <dc:creator>Yaichael</dc:creator>
      <dc:date>2016-09-13T19:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't my search sorting events chronologically by month?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-my-search-sorting-events-chronologically-by-month/m-p/283719#M85748</link>
      <description>&lt;P&gt;You could also, just remove hyphen from the sort command (which sorts in descending order) to use just &lt;CODE&gt;sort month_num&lt;/CODE&gt;. &lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 19:37:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-my-search-sorting-events-chronologically-by-month/m-p/283719#M85748</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-13T19:37:15Z</dc:date>
    </item>
  </channel>
</rss>

