<?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: sort csv by current dates in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/sort-csv-by-current-dates/m-p/369308#M108799</link>
    <description>&lt;P&gt;The sorting that you've before chart will be ineffective as chart would do it's own sorting of output which is always in ascending order, for both rows and columns. There can be different workaround that you can try, one is prefix a sequence number in date column so that when chart sorts it, it's in the order you need. &lt;/P&gt;

&lt;P&gt;Other workaround works if the month values that you're searching on are relative to current time OR relative to time range of the search. Is that the case?&lt;/P&gt;</description>
    <pubDate>Fri, 27 Apr 2018 15:17:25 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-04-27T15:17:25Z</dc:date>
    <item>
      <title>sort csv by current dates</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-csv-by-current-dates/m-p/369305#M108796</link>
      <description>&lt;P&gt;I want to sort out a csv but it not working &lt;/P&gt;

&lt;P&gt;tried&lt;BR /&gt;
 ......| fields Date,count | stats by Date,count | eval Date=strptime(Date, "%d/%m/%Y") | sort Date | eval Date=strftime(Date, "%m/%Y") | chart as total over t1 by Date &lt;/P&gt;

&lt;P&gt;I keep getting &lt;BR /&gt;
01/2018&lt;BR /&gt;
02/2018&lt;BR /&gt;
03/2018&lt;/P&gt;

&lt;P&gt;This is the result i am expecting &lt;BR /&gt;
03/2018&lt;BR /&gt;
02/2018&lt;BR /&gt;
01/2018&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 14:28:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-csv-by-current-dates/m-p/369305#M108796</guid>
      <dc:creator>Bentash</dc:creator>
      <dc:date>2018-04-27T14:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: sort csv by current dates</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-csv-by-current-dates/m-p/369306#M108797</link>
      <description>&lt;P&gt;Try &lt;CODE&gt;sort - Date&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 14:32:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-csv-by-current-dates/m-p/369306#M108797</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-27T14:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: sort csv by current dates</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-csv-by-current-dates/m-p/369307#M108798</link>
      <description>&lt;P&gt;To change the sort order, use &lt;CODE&gt;| sort -Date&lt;/CODE&gt; to make it sort in descending order.&lt;/P&gt;

&lt;P&gt;PS: you might want to put the sort before replacing the Date value with a string, as sorting strings may not always result in a correct sorting of dates. Or use &lt;CODE&gt;fieldformat&lt;/CODE&gt; instead of eval, such that under the hood, it keeps the numerical timestamp value and only renders it as a string.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 14:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-csv-by-current-dates/m-p/369307#M108798</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-04-27T14:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: sort csv by current dates</title>
      <link>https://community.splunk.com/t5/Splunk-Search/sort-csv-by-current-dates/m-p/369308#M108799</link>
      <description>&lt;P&gt;The sorting that you've before chart will be ineffective as chart would do it's own sorting of output which is always in ascending order, for both rows and columns. There can be different workaround that you can try, one is prefix a sequence number in date column so that when chart sorts it, it's in the order you need. &lt;/P&gt;

&lt;P&gt;Other workaround works if the month values that you're searching on are relative to current time OR relative to time range of the search. Is that the case?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 15:17:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/sort-csv-by-current-dates/m-p/369308#M108799</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-04-27T15:17:25Z</dc:date>
    </item>
  </channel>
</rss>

