<?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 How to arrange by month/year chronological order in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-arrange-by-month-year-chronological-order/m-p/333085#M99054</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Im creating a table in which it will count the ticket that was logged per month and I need to do it for the last three months.&lt;BR /&gt;
Im finding a hard time to sort my table by month/year. I need to place them in chronological order with this format month/year.&lt;BR /&gt;
I tried sorting them by %m (but it only sort them in numerical order) and %b(but it sort them in alphabetical order. My table is looking like this. &lt;/P&gt;

&lt;P&gt;Month       count&lt;BR /&gt;
Dec/2017  38&lt;BR /&gt;&lt;BR /&gt;
Feb/2018  2829&lt;BR /&gt;&lt;BR /&gt;
Jan/2018  933&lt;BR /&gt;&lt;BR /&gt;
Mar/2018  590  &lt;/P&gt;

&lt;P&gt;My query:&lt;BR /&gt;
.......search query&lt;BR /&gt;
| eval created_at=strptime(opened_at,"%d/%m/%Y %H:%M:%S")&lt;BR /&gt;
| eval Month=strftime(created_at,"%b/%Y")&lt;BR /&gt;
| eval epoch = strptime(opened_at,"%d/%m/%Y %H:%M:%S") | eval diff = (now() - epoch)/60 | where diff &amp;lt; 131400&lt;BR /&gt;
| stats count(ticket_number) by Month&lt;/P&gt;

&lt;P&gt;Could anyone help me on this. Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 18:19:43 GMT</pubDate>
    <dc:creator>NicoloPunzalan2</dc:creator>
    <dc:date>2020-09-29T18:19:43Z</dc:date>
    <item>
      <title>How to arrange by month/year chronological order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-arrange-by-month-year-chronological-order/m-p/333085#M99054</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Im creating a table in which it will count the ticket that was logged per month and I need to do it for the last three months.&lt;BR /&gt;
Im finding a hard time to sort my table by month/year. I need to place them in chronological order with this format month/year.&lt;BR /&gt;
I tried sorting them by %m (but it only sort them in numerical order) and %b(but it sort them in alphabetical order. My table is looking like this. &lt;/P&gt;

&lt;P&gt;Month       count&lt;BR /&gt;
Dec/2017  38&lt;BR /&gt;&lt;BR /&gt;
Feb/2018  2829&lt;BR /&gt;&lt;BR /&gt;
Jan/2018  933&lt;BR /&gt;&lt;BR /&gt;
Mar/2018  590  &lt;/P&gt;

&lt;P&gt;My query:&lt;BR /&gt;
.......search query&lt;BR /&gt;
| eval created_at=strptime(opened_at,"%d/%m/%Y %H:%M:%S")&lt;BR /&gt;
| eval Month=strftime(created_at,"%b/%Y")&lt;BR /&gt;
| eval epoch = strptime(opened_at,"%d/%m/%Y %H:%M:%S") | eval diff = (now() - epoch)/60 | where diff &amp;lt; 131400&lt;BR /&gt;
| stats count(ticket_number) by Month&lt;/P&gt;

&lt;P&gt;Could anyone help me on this. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:19:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-arrange-by-month-year-chronological-order/m-p/333085#M99054</guid>
      <dc:creator>NicoloPunzalan2</dc:creator>
      <dc:date>2020-09-29T18:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange by month/year chronological order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-arrange-by-month-year-chronological-order/m-p/333086#M99055</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.......search query
| eval created_at=strptime(opened_at,"%d/%m/%Y %H:%M:%S")
| eval Month=strftime(created_at,"%b/%Y")
| eval date_month=strftime(created_at,”%m")
| eval date_year=strftime(created_at,"%Y")
| eval epoch = strptime(opened_at,"%d/%m/%Y %H:%M:%S") | eval diff = (now() - epoch)/60 | where diff &amp;lt; 131400
| stats count(ticket_number) by Month date_month date_year
| sort- date_year date_month | fields- date_year date_month
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 05:32:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-arrange-by-month-year-chronological-order/m-p/333086#M99055</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-03-07T05:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to arrange by month/year chronological order</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-arrange-by-month-year-chronological-order/m-p/333087#M99056</link>
      <description>&lt;P&gt;Thanks mayurr98.&lt;/P&gt;

&lt;P&gt;It worked! Really appreciate it.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 05:51:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-arrange-by-month-year-chronological-order/m-p/333087#M99056</guid>
      <dc:creator>NicoloPunzalan2</dc:creator>
      <dc:date>2018-03-07T05:51:31Z</dc:date>
    </item>
  </channel>
</rss>

