<?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 sorting by time results in lost records in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-sorting-by-time-results-in-lost-records/m-p/445599#M167625</link>
    <description>&lt;P&gt;Thanks for the advice.  This is really helping me get an idea of what I can do with splunk reporting&lt;/P&gt;

&lt;P&gt;It seams whatever I do causes problems when I want to sort oldest first.   I also found the "|reverse| command which is a little simpler since I don't have to worry I am messing up the date format string.      I find that all the regular and reverse queries appear to yield the same number of records, when I export to CSV, the report lengths are quite different.  &lt;/P&gt;

&lt;P&gt;Adding "NOT" to my queries seems to be  the culprit .    For example , the following query is missing event records when I try to sort oldest first. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;           (host=somehost AND "this_string"  NOT "that_string") | sort _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the following query is does show all records &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;           (host=somehost AND "this_string"  OR "that_string") | sort _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 07 Sep 2018 16:08:04 GMT</pubDate>
    <dc:creator>echelon101</dc:creator>
    <dc:date>2018-09-07T16:08:04Z</dc:date>
    <item>
      <title>Help sorting by time results in lost records</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-sorting-by-time-results-in-lost-records/m-p/445596#M167622</link>
      <description>&lt;P&gt;When I do a sort, the records show up newest first.   I will typically search for events on the duration of a week or a month.     If I add "| sort time" or "| sort _time" , the records will show up oldest first.  The count of events does not change but I am missing events from the first day or two.     &lt;/P&gt;

&lt;P&gt;For example, with the time picker selecting all of July &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;            (host="myfirewall") AND ("2018-07-01" OR "2018-07-02" OR "2018-07-03")  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will return 89 records, including all 3 days. &lt;/P&gt;

&lt;P&gt;However, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;          (host="myfirewall") AND ("2018-07-01" OR "2018-07-02" OR "2018-07-03")  | SORT time 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will return 89 records, oldest first, but does not include "2018-07-01"&lt;/P&gt;

&lt;P&gt;Using &lt;BR /&gt;
    | SORT -time &lt;/P&gt;

&lt;P&gt;will return 89 records, newest first, but does not include "2018-07-01"&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 18:54:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-sorting-by-time-results-in-lost-records/m-p/445596#M167622</guid>
      <dc:creator>echelon101</dc:creator>
      <dc:date>2018-09-06T18:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help sorting by time results in lost records</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-sorting-by-time-results-in-lost-records/m-p/445597#M167623</link>
      <description>&lt;P&gt;Always do &lt;CODE&gt;| sort _time&lt;/CODE&gt; and tell me if after that the events still get lost in the void.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 19:33:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-sorting-by-time-results-in-lost-records/m-p/445597#M167623</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2018-09-06T19:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help sorting by time results in lost records</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-sorting-by-time-results-in-lost-records/m-p/445598#M167624</link>
      <description>&lt;P&gt;I have tried the following&lt;/P&gt;

&lt;P&gt;| sort _time&lt;BR /&gt;
| sort -_time&lt;BR /&gt;
| sort  time &lt;BR /&gt;
| sort -time&lt;/P&gt;

&lt;P&gt;with the same results.&lt;/P&gt;

&lt;P&gt;If I look at an event log fields  in a recent event I see that &lt;BR /&gt;
    time = 2018-08-27 08:14:26&lt;BR /&gt;
        _time = 2018-08-27T08:08:11.000-04:00 &lt;/P&gt;

&lt;P&gt;The problem may be occurring in search queries that are relatively complex  (e.g. where I search for firewall events and have a log  "NOT (this OR that OR ...) " statement to filter out events that aren't of interest.   I tried to make sure that the entire query prior to the " | sort .... "  entry was in ().     &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:09:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-sorting-by-time-results-in-lost-records/m-p/445598#M167624</guid>
      <dc:creator>echelon101</dc:creator>
      <dc:date>2020-09-29T21:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help sorting by time results in lost records</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-sorting-by-time-results-in-lost-records/m-p/445599#M167625</link>
      <description>&lt;P&gt;Thanks for the advice.  This is really helping me get an idea of what I can do with splunk reporting&lt;/P&gt;

&lt;P&gt;It seams whatever I do causes problems when I want to sort oldest first.   I also found the "|reverse| command which is a little simpler since I don't have to worry I am messing up the date format string.      I find that all the regular and reverse queries appear to yield the same number of records, when I export to CSV, the report lengths are quite different.  &lt;/P&gt;

&lt;P&gt;Adding "NOT" to my queries seems to be  the culprit .    For example , the following query is missing event records when I try to sort oldest first. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;           (host=somehost AND "this_string"  NOT "that_string") | sort _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the following query is does show all records &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;           (host=somehost AND "this_string"  OR "that_string") | sort _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Sep 2018 16:08:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-sorting-by-time-results-in-lost-records/m-p/445599#M167625</guid>
      <dc:creator>echelon101</dc:creator>
      <dc:date>2018-09-07T16:08:04Z</dc:date>
    </item>
  </channel>
</rss>

