<?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: help on time sorting in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567979#M10057</link>
    <description>&lt;P&gt;sorry but it doesnt works&lt;/P&gt;</description>
    <pubDate>Wed, 22 Sep 2021 09:46:34 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2021-09-22T09:46:34Z</dc:date>
    <item>
      <title>help on time sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567884#M10042</link>
      <description>&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;I dont succeed to sort the events by time&lt;/P&gt;&lt;P&gt;the format time field is for example :&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="key level-1"&gt;&lt;SPAN class="t number h"&gt;1632218561&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;what is wrong please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="tutu" sourcetype="toto"  
| search statustext=TimedOut 
| sort - time 
| eval time = strftime(_time, "%d-%m-%y %H:%M") 
| stats last(time) as Heure, last(statustext) as statustext by desktop &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 17:37:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567884#M10042</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2021-09-21T17:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: help on time sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567887#M10043</link>
      <description>&lt;P&gt;The field to be sorted must exist before sorting.&amp;nbsp; IOW, put the &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; command before the &lt;FONT face="courier new,courier"&gt;sort&lt;/FONT&gt; command or sort the _time field (which always exists).&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 18:05:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567887#M10043</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-09-21T18:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: help on time sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567891#M10044</link>
      <description>&lt;P&gt;Also remember that if you do strftime and convert your _time to some string representation, it will be sorted alphabeticaly, not date-wise!&lt;/P&gt;&lt;P&gt;So you'd better use _time.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 18:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567891#M10044</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-21T18:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: help on time sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567944#M10053</link>
      <description>&lt;P&gt;sorry but same also with _time....&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval _time = strftime(_time, "%d-%m-%y %H:%M") 
| sort - _time 
| stats last(_time) as Heure&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Sep 2021 04:47:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567944#M10053</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2021-09-22T04:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: help on time sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567947#M10054</link>
      <description>&lt;P&gt;You can try the following&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;YOUR_SEARCH&amp;gt;
| sort - _time 
| eval Heure=strftime(_time, "%d-%m-%y %H:%M") 
| stats last(Heure) as Heure&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Sep 2021 05:26:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567947#M10054</guid>
      <dc:creator>danielcj</dc:creator>
      <dc:date>2021-09-22T05:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: help on time sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567952#M10055</link>
      <description>&lt;P&gt;No, no, no. Leave _time alone (don't overwrite it, especially, not with string values). You want to have your original _time to sort by it.&lt;/P&gt;&lt;P&gt;So you want to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| sort - _time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As first step of your pipeline.&lt;/P&gt;&lt;P&gt;Besides, instead of sorting and chosing last value, you can use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats earliest(_raw)&lt;/LI-CODE&gt;&lt;P&gt;Or even, in your case, since you're just interested in time&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats earliest_time(_raw)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 05:50:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567952#M10055</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-22T05:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: help on time sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567962#M10056</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/102660"&gt;@jip31&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OK, lots of posts here, so hopefully you're not too confused...&lt;/P&gt;&lt;P&gt;You are trying to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="tutu" sourcetype="toto"  
| search statustext=TimedOut 
| sort - time 
| eval time = strftime(_time, "%d-%m-%y %H:%M") 
| stats last(time) as Heure, last(statustext) as statustext by desktop &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sort time, so that the LATEST time is at the top&lt;/LI&gt;&lt;LI&gt;Find the LAST time from the list, i.e. the EARLIEST time&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Sorting is something to avoid, as it's expensive - and not necessary here, sorting should always be done as LATE as possible&lt;/P&gt;&lt;P&gt;All you therefore need is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="tutu" sourcetype="toto" statustext=TimedOut 
| stats earliest(_time) as Heure, earliest(statustext) as statustext by desktop 
| eval time = strftime(_time, "%d-%m-%y %H:%M") &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that you do not need a separate search command for statustext, it can be combined with the first line.&lt;/P&gt;&lt;P&gt;At the end, you will have 4 fields&lt;/P&gt;&lt;P&gt;_time - the epoch time&lt;BR /&gt;time - your formatted time&lt;BR /&gt;&lt;SPAN&gt;statustext + &lt;/SPAN&gt;&lt;SPAN&gt;desktop&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If you then want to sort, you can sort by any of these fields&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 06:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567962#M10056</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-09-22T06:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: help on time sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567979#M10057</link>
      <description>&lt;P&gt;sorry but it doesnt works&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 09:46:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567979#M10057</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2021-09-22T09:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: help on time sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567982#M10058</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;probably you have too many events for sort without limits?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If the first argument to the sort command is a number, then at most that many results are returned, in order. If no number is specified, the default limit of 10000 is used. If the number 0 is specified, all of the results are returned. See the count argument for more information.&lt;/LI-CODE&gt;&lt;P&gt;Can you try sort 0 - time instead of sort - time ?&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 09:51:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567982#M10058</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2021-09-22T09:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: help on time sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567983#M10059</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;it doenst works too&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 09:51:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/help-on-time-sorting/m-p/567983#M10059</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2021-09-22T09:51:20Z</dc:date>
    </item>
  </channel>
</rss>

