<?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: sorting date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135493#M37053</link>
    <description>&lt;P&gt;Hi revathy1993,&lt;/P&gt;

&lt;P&gt;Check this answer &lt;A href="https://answers.splunk.com/answers/714651/tableview-in-javascript-prevent-sorting-or-capture.html"&gt;https://answers.splunk.com/answers/714651/tableview-in-javascript-prevent-sorting-or-capture.html&lt;/A&gt; this depending on your Splunk version this might work. There are older examples for older Splunk version on answers as well, just search for them : &lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.google.com/search?q=site:answers.splunk.com+disable+sort+in+table"&gt;https://www.google.com/search?q=site:answers.splunk.com+disable+sort+in+table&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jan 2020 19:53:53 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2020-01-06T19:53:53Z</dc:date>
    <item>
      <title>How can I sort data into a graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135486#M37046</link>
      <description>&lt;P&gt;I have a table like below.&lt;BR /&gt;Date, count&lt;BR /&gt;22/12/2014,9&lt;BR /&gt;23/12/2014,19&lt;BR /&gt;24/12/2014,16&lt;BR /&gt;6/01/2015,4&lt;BR /&gt;7/01/2015,7&lt;BR /&gt;4/02/2015,42&lt;BR /&gt;5/02/2015,17&lt;/P&gt;
&lt;P&gt;when i use below query, i don't see date in sorted order in my graph. Could you please help how to get graph in sorted order by date.&lt;BR /&gt;source=abcd.csv|fields Date,count|stats by Date,count&lt;/P&gt;
&lt;P&gt;the output is like below, which is not what i want&lt;BR /&gt;22/12/2014,9&lt;BR /&gt;23/12/2014,19&lt;BR /&gt;24/12/2014,16&lt;BR /&gt;4/02/2015,42&lt;BR /&gt;5/02/2015,17&lt;BR /&gt;6/01/2015,4&lt;BR /&gt;7/01/2015,7&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 13:50:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135486#M37046</guid>
      <dc:creator>karthikTIL</dc:creator>
      <dc:date>2023-04-28T13:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: sorting date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135487#M37047</link>
      <description>&lt;P&gt;Hi karthikTIL,&lt;/P&gt;

&lt;P&gt;the problem here is that Splunk is not aware that your &lt;CODE&gt;Date&lt;/CODE&gt; field represents a &lt;CODE&gt;time&lt;/CODE&gt; value; for Splunk it is a simple numeric value and therefore it sorts the value based on the first digits before the first &lt;CODE&gt;/&lt;/CODE&gt;. You need to tell Splunk that this is a time based field, sort it and revert it back to your human readable date value like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | fields Date,count | stats by Date,count | eval Date=strptime(Date, "%d/%m/%Y") | sort Date | eval Date=strftime(Date, "%d/%m/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 11 Feb 2015 08:09:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135487#M37047</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-02-11T08:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: sorting date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135488#M37048</link>
      <description>&lt;P&gt;Hello Karth,&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source=abcd.csv | fields Date,count | eval _time=strptime(Date,"%d/%m/%Y") | stats count by _time,count 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Wed, 11 Feb 2015 08:28:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135488#M37048</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2015-02-11T08:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: sorting date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135489#M37049</link>
      <description>&lt;P&gt;Thanks MuS,&lt;/P&gt;

&lt;P&gt;It works&lt;/P&gt;</description>
      <pubDate>Wed, 11 Feb 2015 22:38:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135489#M37049</guid>
      <dc:creator>karthikTIL</dc:creator>
      <dc:date>2015-02-11T22:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: sorting date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135490#M37050</link>
      <description>&lt;P&gt;Thanks David&lt;/P&gt;</description>
      <pubDate>Wed, 11 Feb 2015 22:38:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135490#M37050</guid>
      <dc:creator>karthikTIL</dc:creator>
      <dc:date>2015-02-11T22:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: sorting date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135491#M37051</link>
      <description>&lt;P&gt;HI MuS,&lt;/P&gt;

&lt;P&gt;with the above query, is it possible to get total count by week and month?&lt;BR /&gt;
say,&lt;BR /&gt;
16/03/2015,10&lt;BR /&gt;
18/03/2015,20&lt;BR /&gt;
23/03/2015,5&lt;BR /&gt;
24/03/2015,15&lt;/P&gt;

&lt;P&gt;I want the count for week ending 22/mar as 30 and week ending 29/mar as 20. Like wise, need to monthly for february/march,etc&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 02:10:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135491#M37051</guid>
      <dc:creator>karthikTIL</dc:creator>
      <dc:date>2015-03-24T02:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: sorting date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135492#M37052</link>
      <description>&lt;P&gt;Hi MuS,&lt;/P&gt;

&lt;P&gt;After sorting it using the above way, once we create a dashboard how to restrict it from sorting on the screen because that arrow sorts as normal numeric again.&lt;/P&gt;

&lt;P&gt;Thank you in advance,&lt;BR /&gt;
Revathy.&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/228iE50EDB4D2DD7B68F/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 16:13:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135492#M37052</guid>
      <dc:creator>revathy1993</dc:creator>
      <dc:date>2020-01-06T16:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: sorting date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135493#M37053</link>
      <description>&lt;P&gt;Hi revathy1993,&lt;/P&gt;

&lt;P&gt;Check this answer &lt;A href="https://answers.splunk.com/answers/714651/tableview-in-javascript-prevent-sorting-or-capture.html"&gt;https://answers.splunk.com/answers/714651/tableview-in-javascript-prevent-sorting-or-capture.html&lt;/A&gt; this depending on your Splunk version this might work. There are older examples for older Splunk version on answers as well, just search for them : &lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.google.com/search?q=site:answers.splunk.com+disable+sort+in+table"&gt;https://www.google.com/search?q=site:answers.splunk.com+disable+sort+in+table&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 19:53:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/135493#M37053</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2020-01-06T19:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: sorting date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/641657#M222269</link>
      <description>&lt;P&gt;Old post but this is how I fixed it in a dashboard.&lt;BR /&gt;&lt;BR /&gt;Convert to epoch, rename what you want the final field to be, then apply fieldformat to the result.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval admin_appcreatedon=strptime(admin_appcreatedon,"%m/%d/%Y")
| rename admin_appcreatedon as "Created On" 
| fieldformat "Created On" = strftime('Created On', "%m/%d/%Y")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 18:54:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-sort-data-into-a-graph/m-p/641657#M222269</guid>
      <dc:creator>ohbuckeyeio</dc:creator>
      <dc:date>2023-04-27T18:54:56Z</dc:date>
    </item>
  </channel>
</rss>

