<?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 Chart by month still alphabetical in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Chart-by-month-still-alphabetical/m-p/38819#M8850</link>
    <description>&lt;P&gt;Still fighting this after looking at many examples.  &lt;/P&gt;

&lt;P&gt;Data looks like this:&lt;BR /&gt;
Kronos,Jun-12,100,Kronos,20120630010101&lt;BR /&gt;
Kronos,May-12,100,Kronos,20120531010101&lt;BR /&gt;
Kronos,Apr-12,98.484,Kronos,20120430010101&lt;BR /&gt;
Fields are App,Month,Uptime,AppOwner,Date.&lt;/P&gt;

&lt;P&gt;This search results in alphabetical when using chart:  index=apps-monthly AND App="Kronos" | chart avg(Uptime) by Month&lt;BR /&gt;
Same thing sindex=apps-monthly AND App="Kronos" |sort + _timestamp | chart avg(Uptime) by Month orting by _timestamp:&lt;BR /&gt;&lt;BR /&gt;
Not very familiar with eval but looking at examples, that may be what is necessary to get this chart to sort properly.&lt;BR /&gt;&lt;BR /&gt;
Can anyone save me some time here?&lt;/P&gt;</description>
    <pubDate>Sun, 19 Aug 2012 13:28:49 GMT</pubDate>
    <dc:creator>bwindham</dc:creator>
    <dc:date>2012-08-19T13:28:49Z</dc:date>
    <item>
      <title>Chart by month still alphabetical</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-by-month-still-alphabetical/m-p/38819#M8850</link>
      <description>&lt;P&gt;Still fighting this after looking at many examples.  &lt;/P&gt;

&lt;P&gt;Data looks like this:&lt;BR /&gt;
Kronos,Jun-12,100,Kronos,20120630010101&lt;BR /&gt;
Kronos,May-12,100,Kronos,20120531010101&lt;BR /&gt;
Kronos,Apr-12,98.484,Kronos,20120430010101&lt;BR /&gt;
Fields are App,Month,Uptime,AppOwner,Date.&lt;/P&gt;

&lt;P&gt;This search results in alphabetical when using chart:  index=apps-monthly AND App="Kronos" | chart avg(Uptime) by Month&lt;BR /&gt;
Same thing sindex=apps-monthly AND App="Kronos" |sort + _timestamp | chart avg(Uptime) by Month orting by _timestamp:&lt;BR /&gt;&lt;BR /&gt;
Not very familiar with eval but looking at examples, that may be what is necessary to get this chart to sort properly.&lt;BR /&gt;&lt;BR /&gt;
Can anyone save me some time here?&lt;/P&gt;</description>
      <pubDate>Sun, 19 Aug 2012 13:28:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-by-month-still-alphabetical/m-p/38819#M8850</guid>
      <dc:creator>bwindham</dc:creator>
      <dc:date>2012-08-19T13:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Chart by month still alphabetical</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-by-month-still-alphabetical/m-p/38820#M8851</link>
      <description>&lt;P&gt;Well your "Month" field is just a field containing text. There's no way for Splunk to know that this specific text corresponds to some number, like that May is month number 5, so the only valid way of sorting is alphabetically. What you need to do in order to have months ordered properly is to point Splunk at a field that contains their actual number equivalent. Since you have these events in Splunk I'm assuming you already have valid timestamps for these events from the Date field. You could sort by this field and then use &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fieldformat"&gt;fieldformat&lt;/A&gt; to have it displayed with the month only (because it looks like you only have one event per month).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=apps-monthly AND App="Kronos" | chart avg(Uptime) by Date | fieldformat Date=strftime(Date,"%b")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or because you already have the Month as a string in your event, just&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=apps-monthly AND App="Kronos" | chart avg(Uptime) by Date | fieldformat Date=Month
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;would do.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Aug 2012 14:51:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-by-month-still-alphabetical/m-p/38820#M8851</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-08-19T14:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Chart by month still alphabetical</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-by-month-still-alphabetical/m-p/38821#M8852</link>
      <description>&lt;P&gt;You put me on the right track....Month was actually mmm-yy.  Used this and it worked:&lt;/P&gt;

&lt;P&gt;index=apps-monthly AND App="Kronos" | chart avg(Uptime) by _time | fieldformat _time=strftime(_time,"%b-%y") | sort - _time&lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:17:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-by-month-still-alphabetical/m-p/38821#M8852</guid>
      <dc:creator>bwindham</dc:creator>
      <dc:date>2020-09-28T12:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Chart by month still alphabetical</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-by-month-still-alphabetical/m-p/38822#M8853</link>
      <description>&lt;P&gt;Awesome. Could you please mark my answer as accepted? Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2012 05:47:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-by-month-still-alphabetical/m-p/38822#M8853</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-08-20T05:47:37Z</dc:date>
    </item>
  </channel>
</rss>

