<?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: Why am I not able to sort the date column in a table by clicking on the header? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191732#M55191</link>
    <description>&lt;P&gt;okay, then why don't you simply eval the date field with the correct name in the first place?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test24 | eval Start_Date=strftime ....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 03 Nov 2014 10:47:54 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-11-03T10:47:54Z</dc:date>
    <item>
      <title>Why am I not able to sort the date column in a table by clicking on the header?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191729#M55188</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;In the logs the START_DATE_PROFILE is in the format "20090914" i.e, (%Y%m%d) . I want to show the date as 14-Sep-2014 and the column name must be "Start Date". I am using this below query but the date is not sorting properly if we click on the column header. Please let me know.&lt;/P&gt;

&lt;P&gt;index=test24 | eval START_DATE_PROFILE=strftime(strptime(START_DATE_PROFILE, "%Y%m%d"), "%d-%b-%Y") | convert timeformat="%d-%b-%Y" mktime(START_DATE_PROFILE) AS START_DATE_PROFILE | fieldformat START_DATE_PROFILE=strftime(START_DATE_PROFILE,"%d-%b-%Y") | table START_DATE_PROFILE |rename START_DATE_PROFILE as "Start Date"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:04:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191729#M55188</guid>
      <dc:creator>srinathd</dc:creator>
      <dc:date>2020-09-28T18:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not able to sort the date column in a table by clicking on the header?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191730#M55189</link>
      <description>&lt;P&gt;Hi srinathd,&lt;/P&gt;

&lt;P&gt;from the docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/Sort"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/Sort&lt;/A&gt; about sorting:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Alphabetic&lt;/STRONG&gt; strings are sorted lexicographically.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Punctuation&lt;/STRONG&gt; strings are sorted lexicographically.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Numeric&lt;/STRONG&gt; data is sorted as you would expect for numbers and the sort order is specified (ascending or descending).&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Alphanumeric&lt;/STRONG&gt; strings are sorted based on the data type of the first character. If it starts with a number, it's sorted numerically based on that number alone; otherwise, it's sorted lexicographically.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Strings&lt;/STRONG&gt; that are a combination of alphanumeric and punctuation characters are sorted the same way as alphanumeric strings.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;hope that helps to understand sorting in Splunk.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2014 10:14:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191730#M55189</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-11-03T10:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not able to sort the date column in a table by clicking on the header?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191731#M55190</link>
      <description>&lt;P&gt;Thanks MuS for your reply. But the sorting is working fine if the column name is "START_DATE_PROFILE". If we rename it to "Start Date" then it is not working. &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:04:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191731#M55190</guid>
      <dc:creator>srinathd</dc:creator>
      <dc:date>2020-09-28T18:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not able to sort the date column in a table by clicking on the header?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191732#M55191</link>
      <description>&lt;P&gt;okay, then why don't you simply eval the date field with the correct name in the first place?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test24 | eval Start_Date=strftime ....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Nov 2014 10:47:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191732#M55191</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-11-03T10:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not able to sort the date column in a table by clicking on the header?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191733#M55192</link>
      <description>&lt;P&gt;column should contain space and it should be sortable. If it has any space in the column header, it is not sorting properly. But i need the column name with space.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2014 11:59:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191733#M55192</guid>
      <dc:creator>srinathd</dc:creator>
      <dc:date>2014-11-03T11:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not able to sort the date column in a table by clicking on the header?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191734#M55193</link>
      <description>&lt;P&gt;this run everywhere command works as it should:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | bucket _time span=1d | stats count by _time | eval foo=strftime(_time, "%Y%m%d")  | eval "b a r"=foo | eval b_a_z=foo| table foo, "b a r", b_a_z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;sorting is possible and working either on &lt;CODE&gt;foo&lt;/CODE&gt;,&lt;CODE&gt;b a r&lt;/CODE&gt; or &lt;CODE&gt;b_a_z&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2014 12:32:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-not-able-to-sort-the-date-column-in-a-table-by-clicking/m-p/191734#M55193</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-11-03T12:32:36Z</dc:date>
    </item>
  </channel>
</rss>

