<?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: Sort command causing lost records in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634957#M220579</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252798"&gt;@buttsurfer&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as you can read at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Sort" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Sort&lt;/A&gt;&amp;nbsp;yu could use:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| sort 0 feature&lt;/LI-CODE&gt;&lt;P&gt;in this way you don't limit results.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2023 16:30:32 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-03-17T16:30:32Z</dc:date>
    <item>
      <title>Sort command causing lost records?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634951#M220575</link>
      <description>&lt;P&gt;I have a very simple search and when I add the sort command i lose almost 90% of my actual results.&amp;nbsp;&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="features" application=kokoapp type=userStats
| sort feature
| dedup feature
| table feature &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;
&lt;P&gt;Without the sort command I get 35 results and with it included i only get 4 results. Is there something I am missing?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 14:43:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634951#M220575</guid>
      <dc:creator>buttsurfer</dc:creator>
      <dc:date>2023-03-20T14:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sort command causing lost records</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634954#M220576</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252798"&gt;@buttsurfer&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;sort cuts results only if you have more than 10,000 results.&lt;/P&gt;&lt;P&gt;probably is dedup that deletes some events.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 16:11:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634954#M220576</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-17T16:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sort command causing lost records</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634955#M220577</link>
      <description>&lt;P&gt;Turns out there actually are over 10,000 results. But I need them all - is there a workaround to this?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 16:14:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634955#M220577</guid>
      <dc:creator>buttsurfer</dc:creator>
      <dc:date>2023-03-17T16:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sort command causing lost records</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634957#M220579</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252798"&gt;@buttsurfer&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as you can read at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Sort" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Sort&lt;/A&gt;&amp;nbsp;yu could use:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| sort 0 feature&lt;/LI-CODE&gt;&lt;P&gt;in this way you don't limit results.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 16:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634957#M220579</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-17T16:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Sort command causing lost records</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634960#M220581</link>
      <description>&lt;P&gt;10k limit for sort is one thing but if you say that you get 4 out of 35 results, that's way under 10k &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Remember that dedup works by leaving first event with given field(s) and then dropping other subsequent results with this field(s). So it is most probably the culprit here. When you sort by a field then dedup by this field you'll effectively leave just one event per each possible value of this field.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 16:57:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634960#M220581</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-03-17T16:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sort command causing lost records</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634989#M220597</link>
      <description>&lt;P&gt;You can try to raise limit in&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Limitsconf" target="_blank" rel="noopener"&gt;limits.conf&lt;/A&gt;. &amp;nbsp;But I don't understand what you mean by you need all &amp;gt;10,000 results because your dedup without sort only gives you 35.&lt;/P&gt;&lt;P&gt;If you want to sort by feature, sort after dedup. (Sort is memory-intensive; performing sort on any sizable chunk should always be deliberate.)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="features" application=kokoapp type=userStats
| dedup feature
| sort feature
| table feature &lt;/LI-CODE&gt;&lt;P&gt;This should give you the same desired result.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 23:35:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634989#M220597</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-03-17T23:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sort command causing lost records</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634991#M220599</link>
      <description>&lt;P&gt;Definitely you should 1st dedup and then sort. Otherwise there is possibility that you hit 10k limits and even that you wasted resources.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 23:40:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Sort-command-causing-lost-records/m-p/634991#M220599</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-03-17T23:40:38Z</dc:date>
    </item>
  </channel>
</rss>

