<?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: How do you do sort values in format %m/%y ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140077#M38622</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="C:\...\teste.csv" | eval datetime = strptime("01/".duration,"%d/%m/%Y") | chart count over datetime by gender | fieldformat datetime=strftime(datetime,"%m/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The strptime needs day part as well to work.&lt;/P&gt;</description>
    <pubDate>Sun, 13 Jul 2014 06:13:45 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-07-13T06:13:45Z</dc:date>
    <item>
      <title>How do you do sort values in format %m/%y ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140072#M38617</link>
      <description>&lt;P&gt;Hi splunkers, &lt;/P&gt;

&lt;P&gt;I have a search, which return a field called duration. The field durantion is like 03/2013 (%m/%y). I would like to sort these values.  &lt;/P&gt;

&lt;P&gt;When I runs my search, I have following values:&lt;/P&gt;

&lt;P&gt;(...) | stats count by duration | sort - duration&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;12/2013  1
11/2013  1
10/2013  1
09/2013  1
08/2013  1
07/2014  1 *** Look my problem
07/2013  1 ***
06/2014  1
05/2014  1 
04/2014  1
03/2014  1
02/2014  1
01/2014      1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any idea? &lt;/P&gt;

&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jul 2014 01:34:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140072#M38617</guid>
      <dc:creator>dfigurello</dc:creator>
      <dc:date>2014-07-12T01:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do sort values in format %m/%y ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140073#M38618</link>
      <description>&lt;P&gt;You could do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| eval datetime = strptime(duration,"%m/%Y")
| sort datetime
| fields - datetime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 12 Jul 2014 07:34:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140073#M38618</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-07-12T07:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do sort values in format %m/%y ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140074#M38619</link>
      <description>&lt;P&gt;Hey Iguinn, &lt;/P&gt;

&lt;P&gt;Thank you for your response, but when I use the chart command it doesn't work. &lt;/P&gt;

&lt;P&gt;I created a csv file to replicate the problem in the customer, for example:&lt;/P&gt;

&lt;P&gt;date    gender&lt;BR /&gt;
01/2014 F&lt;BR /&gt;
01/2013 M&lt;BR /&gt;
01/2014 F&lt;BR /&gt;
01/2014 M&lt;BR /&gt;
11/2013 F&lt;BR /&gt;
11/2013 M&lt;BR /&gt;
10/2013 F&lt;BR /&gt;
10/2014 M&lt;BR /&gt;
10/2013 F&lt;BR /&gt;
09/2013 F&lt;BR /&gt;
09/2013 M&lt;BR /&gt;
09/2013 F&lt;/P&gt;

&lt;P&gt;I want to create a chart for analyze the gender and period. &lt;/P&gt;

&lt;P&gt;This is my search: &lt;/P&gt;

&lt;P&gt;source="C:\...\teste.csv" | chart count over duration by gender | sort duration&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com//storage/splunk1error_1.jpg"&gt;http://answers.splunk.com//storage/splunk1error_1.jpg&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Any idea ? &lt;/P&gt;

&lt;P&gt;Tks!&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jul 2014 04:52:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140074#M38619</guid>
      <dc:creator>dfigurello</dc:creator>
      <dc:date>2014-07-13T04:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do sort values in format %m/%y ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140075#M38620</link>
      <description>&lt;P&gt;Do this&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;source="C:\...\teste.csv" &lt;BR /&gt;
| eval datetime = strptime(duration,"%m/%Y")&lt;BR /&gt;
| chart count over datetime by gender&lt;BR /&gt;
| fieldformat datetime=strftime(datetime,"%m/%Y")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jul 2014 05:39:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140075#M38620</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-07-13T05:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do sort values in format %m/%y ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140076#M38621</link>
      <description>&lt;P&gt;Iguinn, &lt;/P&gt;

&lt;P&gt;When I runs source="C:...\teste.csv" &lt;BR /&gt;
| eval datetime = strptime(duration,"%m/%Y") , I saw that datetime field is not create. I believe that is my problem.&lt;/P&gt;

&lt;P&gt;Tks!&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jul 2014 06:00:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140076#M38621</guid>
      <dc:creator>dfigurello</dc:creator>
      <dc:date>2014-07-13T06:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do sort values in format %m/%y ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140077#M38622</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="C:\...\teste.csv" | eval datetime = strptime("01/".duration,"%d/%m/%Y") | chart count over datetime by gender | fieldformat datetime=strftime(datetime,"%m/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The strptime needs day part as well to work.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jul 2014 06:13:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140077#M38622</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-13T06:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do sort values in format %m/%y ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140078#M38623</link>
      <description>&lt;P&gt;I get it! &lt;/P&gt;

&lt;P&gt;Thank you so much somesoni2 and Iguinn!&lt;BR /&gt;
Monday I'll test customer's splunk.. &lt;/P&gt;

&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jul 2014 06:20:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-do-sort-values-in-format-m-y/m-p/140078#M38623</guid>
      <dc:creator>dfigurello</dc:creator>
      <dc:date>2014-07-13T06:20:01Z</dc:date>
    </item>
  </channel>
</rss>

