<?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 to sort concatenated DATE&amp;amp;TIME  field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-concatenated-DATE-amp-TIME-field/m-p/522917#M147461</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222977"&gt;@Ashwini008&lt;/a&gt;&amp;nbsp;.. you have to convert to epoch and sort and then convert back to your format.&amp;nbsp; pls check the below SPL query. thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...  | eval DATETIME=DATE." ".TIME 
| eval sortDate=strptime(DATETIME, "%m/%d/%Y %H:%S") | sort sortDate 
| eval DATETIME=strftime(SortDate, "%m/%d/%Y %H:%S")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(PS - i have given around 500+ karma points so far, received badge for that, if an answer helped you, a karma point would be nice!. we all should start "Learn, Give Back, Have Fun")&lt;/P&gt;</description>
    <pubDate>Mon, 05 Oct 2020 07:23:24 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2020-10-05T07:23:24Z</dc:date>
    <item>
      <title>How to sort concatenated DATE&amp;TIME  field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-concatenated-DATE-amp-TIME-field/m-p/522916#M147460</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have concatenated my DATE &amp;amp; TIME Field as below&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| eval DATE&amp;amp;TIME=DATE." ".TIME&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EXAMPLE:(%m/%d/%Y&amp;nbsp; %H:%S)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;12/09/2017 23:28&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;01/27/2019 00:49&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;04/14/2018 23:42&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How to sort my DATE&amp;amp;TIME field now .I want to show the latest date and time field at the beginning?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 07:09:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-concatenated-DATE-amp-TIME-field/m-p/522916#M147460</guid>
      <dc:creator>Ashwini008</dc:creator>
      <dc:date>2020-10-05T07:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort concatenated DATE&amp;TIME  field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-concatenated-DATE-amp-TIME-field/m-p/522917#M147461</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222977"&gt;@Ashwini008&lt;/a&gt;&amp;nbsp;.. you have to convert to epoch and sort and then convert back to your format.&amp;nbsp; pls check the below SPL query. thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...  | eval DATETIME=DATE." ".TIME 
| eval sortDate=strptime(DATETIME, "%m/%d/%Y %H:%S") | sort sortDate 
| eval DATETIME=strftime(SortDate, "%m/%d/%Y %H:%S")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(PS - i have given around 500+ karma points so far, received badge for that, if an answer helped you, a karma point would be nice!. we all should start "Learn, Give Back, Have Fun")&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 07:23:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-concatenated-DATE-amp-TIME-field/m-p/522917#M147461</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-10-05T07:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to sort concatenated DATE&amp;TIME  field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sort-concatenated-DATE-amp-TIME-field/m-p/522922#M147464</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737"&gt;@inventsekar&lt;/a&gt;&amp;nbsp;I tried your solution but it didn't work.The field was still in random order.&lt;/P&gt;&lt;P&gt;However i tried the below code and it worked for me&lt;/P&gt;&lt;P&gt;| eval EPOCHDATE=strptime(DATE,"%Y%m%d")&lt;BR /&gt;| sort -EPOCHDATE&lt;BR /&gt;| eval EPOCHTIME=strptime(TIME,"%H%M%S")&lt;BR /&gt;| sort -EPCOHTIME&lt;BR /&gt;| eval DATE=strftime(EPOCHDATE,"%m/%d/%Y")&lt;BR /&gt;| eval TIME=strftime(EPOCHTIME,"%H:%M")&lt;BR /&gt;| eval DATE&amp;amp;TIME=DATE." ".TIME&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 08:00:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sort-concatenated-DATE-amp-TIME-field/m-p/522922#M147464</guid>
      <dc:creator>Ashwini008</dc:creator>
      <dc:date>2020-10-05T08:00:13Z</dc:date>
    </item>
  </channel>
</rss>

