<?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: Timeformat not sorting properly in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timeformat-not-sorting-properly/m-p/66240#M16443</link>
    <description>&lt;P&gt;I figured it out.  Timestamps is just a number before you convert the format so it sorts correctly so you need to sort t=he time before you convert the format like this.&lt;/P&gt;

&lt;P&gt;sourcetype="foo" name="foobar*" | sort - _time | convert timeformat="%m/%d/%Y - %a" ctime(_time) AS Date | convert timeformat="%H:%M:%S.%N" ctime(_time) AS Time | table Time Date host name category | rename host as Server name as Name category as Category &lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 12:58:50 GMT</pubDate>
    <dc:creator>hartfoml</dc:creator>
    <dc:date>2020-09-28T12:58:50Z</dc:date>
    <item>
      <title>Timeformat not sorting properly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timeformat-not-sorting-properly/m-p/66236#M16439</link>
      <description>&lt;P&gt;I am using this search:&lt;/P&gt;

&lt;P&gt;sourcetype="foo" name="foobar*" | convert timeformat="%m/%d/%Y - %a" ctime(_time) AS Date | convert timeformat="%H:%M:%S.%N" ctime(_time) AS Time | table  Time Date host name category | rename host as Server name as Name category as Category | sort - Time&lt;/P&gt;

&lt;P&gt;The sort is not working.  can anyone suggest what it is I am doing wrong with the sort or timeformat and how to fix it???&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2012 20:27:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timeformat-not-sorting-properly/m-p/66236#M16439</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2012-12-17T20:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Timeformat not sorting properly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timeformat-not-sorting-properly/m-p/66237#M16440</link>
      <description>&lt;P&gt;Maybe I'm wrong but should it work if :&lt;/P&gt;

&lt;P&gt;sourcetype="foo" name="foobar*" | convert timeformat="%m/%d/%Y - %a" ctime(_time) AS Date | convert timeformat="%H:%M:%S.%N" ctime(_time) AS Time | sort - Time | table  Time Date host name category | rename host as Server name as Name category as Category&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:58:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timeformat-not-sorting-properly/m-p/66237#M16440</guid>
      <dc:creator>quatral</dc:creator>
      <dc:date>2020-09-28T12:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Timeformat not sorting properly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timeformat-not-sorting-properly/m-p/66238#M16441</link>
      <description>&lt;P&gt;this works for | sort Time |&lt;BR /&gt;
it does not work for | sort - Time |&lt;/P&gt;

&lt;P&gt;I can use it though.  please put it in as an answer so I can give you credit for the answer&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2012 20:42:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timeformat-not-sorting-properly/m-p/66238#M16441</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2012-12-17T20:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Timeformat not sorting properly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timeformat-not-sorting-properly/m-p/66239#M16442</link>
      <description>&lt;P&gt;Nope sorry this does not work in the search.  Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2012 20:46:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timeformat-not-sorting-properly/m-p/66239#M16442</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2012-12-17T20:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Timeformat not sorting properly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timeformat-not-sorting-properly/m-p/66240#M16443</link>
      <description>&lt;P&gt;I figured it out.  Timestamps is just a number before you convert the format so it sorts correctly so you need to sort t=he time before you convert the format like this.&lt;/P&gt;

&lt;P&gt;sourcetype="foo" name="foobar*" | sort - _time | convert timeformat="%m/%d/%Y - %a" ctime(_time) AS Date | convert timeformat="%H:%M:%S.%N" ctime(_time) AS Time | table Time Date host name category | rename host as Server name as Name category as Category &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:58:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timeformat-not-sorting-properly/m-p/66240#M16443</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2020-09-28T12:58:50Z</dc:date>
    </item>
  </channel>
</rss>

