<?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 is the chart command returning months in alphabetical order? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377305#M110687</link>
    <description>&lt;P&gt;While this sort the fields the output which is the count is empty. The result is empty .&lt;/P&gt;</description>
    <pubDate>Tue, 06 Nov 2018 16:50:11 GMT</pubDate>
    <dc:creator>archu_01</dc:creator>
    <dc:date>2018-11-06T16:50:11Z</dc:date>
    <item>
      <title>Why is the chart command returning months in alphabetical order?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377303#M110685</link>
      <description>&lt;P&gt;I am trying to sort the data month wise using the chart command. However the month is getting sorted alphabetically.&lt;/P&gt;

&lt;P&gt;I tried referring the older post around the same topic, but none of solution works.&lt;/P&gt;

&lt;P&gt;Tried all of these options &lt;/P&gt;

&lt;P&gt;base search | eval Month =strftime(_time,"%b") | chart count over rules by Month&lt;BR /&gt;
    base search  | eval Month =strftime(_time,"%b") | chart count over rules by Month | eval sort=case(Month=="Jan","1",&lt;BR /&gt;
    Month=="Feb","2",       Month=="Mar","3",       Month=="Apr","4",       Month=="May","5",       Month=="Jun","6",       Month=="Jul","7",&lt;BR /&gt;&lt;BR /&gt;
    Month=="Aug","8",       Month=="Sep","9",       Month=="Oct","10",       Month=="Nov","11",       Month=="Dec","12")|sort sort |fields - &lt;BR /&gt;
    sort&lt;/P&gt;

&lt;P&gt;The query that works is by numeric(as shown below) , but how do I convert the numeric to represent "month Name" as "Sep 2018,oct 2018 "?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | eval Monthnum =strftime(_time,"%m") | chart count over rules by Monthnum 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:55:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377303#M110685</guid>
      <dc:creator>archu_01</dc:creator>
      <dc:date>2020-09-29T21:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the chart command returning months in alphabetical order?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377304#M110686</link>
      <description>&lt;P&gt;@archu_01,&lt;/P&gt;

&lt;P&gt;Try specifying the month names with &lt;CODE&gt;fields&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | eval Month =strftime(_time,"%b") | chart count over rules by Month
|fields rules,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Nov 2018 07:18:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377304#M110686</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-11-06T07:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the chart command returning months in alphabetical order?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377305#M110687</link>
      <description>&lt;P&gt;While this sort the fields the output which is the count is empty. The result is empty .&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 16:50:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377305#M110687</guid>
      <dc:creator>archu_01</dc:creator>
      <dc:date>2018-11-06T16:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the chart command returning months in alphabetical order?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377306#M110688</link>
      <description>&lt;P&gt;rechecked the result set, the data is working. however if I set the time frame to last 90 days then  how can we display the data just to show Aug,sep,oct, Nov ? since we mentioned all the months in the fields command other months populate as results and show 0 count ?&lt;/P&gt;

&lt;P&gt;rules Jan feb Mar Apr Jun Jul Aug Sep Oct Nov Dec&lt;BR /&gt;
xxx                                             200 10   300  500&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 17:08:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377306#M110688</guid>
      <dc:creator>archu_01</dc:creator>
      <dc:date>2018-11-06T17:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the chart command returning months in alphabetical order?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377307#M110689</link>
      <description>&lt;P&gt;I got what you mean. I will try for a solution and meanwhile I will move as a comment so that others might be able to help you&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 05:49:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377307#M110689</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-11-07T05:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the chart command returning months in alphabetical order?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377308#M110690</link>
      <description>&lt;P&gt;@archu_01,&lt;/P&gt;

&lt;P&gt;Try this and see if it works for you&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; base search | eval Month =strftime(_time,"%b") | chart count over rules by Month
 |fields rules,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec
 |transpose|transpose header_field=column |fields - column
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Nov 2018 13:28:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377308#M110690</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-11-07T13:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the chart command returning months in alphabetical order?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377309#M110691</link>
      <description>&lt;P&gt;cool this works. I haven't used transpose but looks like the query limits the rows only to 5, can we make the limit 0 ?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 16:18:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377309#M110691</guid>
      <dc:creator>archu_01</dc:creator>
      <dc:date>2018-11-07T16:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the chart command returning months in alphabetical order?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377310#M110692</link>
      <description>&lt;P&gt;@archu_01,&lt;BR /&gt;
yes ofcourse, just add &lt;CODE&gt;transpose 0&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;See the int in &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.2.0/SearchReference/Transpose#Optional_arguments"&gt;http://docs.splunk.com/Documentation/Splunk/7.2.0/SearchReference/Transpose#Optional_arguments&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 05:39:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377310#M110692</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-11-08T05:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the chart command returning months in alphabetical order?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377311#M110693</link>
      <description>&lt;P&gt;Thanks this works !!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 08:04:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-chart-command-returning-months-in-alphabetical-order/m-p/377311#M110693</guid>
      <dc:creator>archu_01</dc:creator>
      <dc:date>2018-11-09T08:04:53Z</dc:date>
    </item>
  </channel>
</rss>

