<?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 limit search results to * % of all results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667896#M229151</link>
    <description>&lt;P&gt;You can either use the&amp;nbsp;&lt;STRONG&gt;top&lt;/STRONG&gt; command (&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Top" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Top&lt;/A&gt;)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| top &amp;lt;your_field&amp;gt; limit=&amp;lt;your_choice&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OR&lt;BR /&gt;you can use&amp;nbsp;&lt;STRONG&gt;sort&lt;/STRONG&gt; and the use &lt;STRONG&gt;head&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| sort - count 
| head &amp;lt;number_of_choice&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If this is inside a dashboard you could create a token based on the amount of search results and input it as the number for head or top command.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2023 14:36:19 GMT</pubDate>
    <dc:creator>FelixLeh</dc:creator>
    <dc:date>2023-11-08T14:36:19Z</dc:date>
    <item>
      <title>How to limit search results to * % of all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667891#M229148</link>
      <description>&lt;P&gt;I've got a search query which outputs 175 rows. I want it to output only top 5%. The row count will change over time so I cannot set a fixed int value. It needs to be dynamic.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 14:02:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667891#M229148</guid>
      <dc:creator>kk2204</dc:creator>
      <dc:date>2023-11-08T14:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit search results to * % of all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667896#M229151</link>
      <description>&lt;P&gt;You can either use the&amp;nbsp;&lt;STRONG&gt;top&lt;/STRONG&gt; command (&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Top" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Top&lt;/A&gt;)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| top &amp;lt;your_field&amp;gt; limit=&amp;lt;your_choice&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OR&lt;BR /&gt;you can use&amp;nbsp;&lt;STRONG&gt;sort&lt;/STRONG&gt; and the use &lt;STRONG&gt;head&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| sort - count 
| head &amp;lt;number_of_choice&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If this is inside a dashboard you could create a token based on the amount of search results and input it as the number for head or top command.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 14:36:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667896#M229151</guid>
      <dc:creator>FelixLeh</dc:creator>
      <dc:date>2023-11-08T14:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit search results to * % of all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667899#M229152</link>
      <description>&lt;P&gt;I know that but with your solution I can only use integers such as 5,1,10 etc. I want to limit the results to a certain percentage of all possible results.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 14:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667899#M229152</guid>
      <dc:creator>kk2204</dc:creator>
      <dc:date>2023-11-08T14:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit search results to * % of all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667900#M229153</link>
      <description>&lt;PRE&gt;&amp;lt;yoursearch&amp;gt;&lt;BR /&gt;| evenstats count as total&lt;BR /&gt;| streamstats count as current&lt;BR /&gt;| where current&amp;lt;=0.15*total&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Nov 2023 14:42:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667900#M229153</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-11-08T14:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit search results to * % of all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667902#M229154</link>
      <description>&lt;P&gt;Great Solution!&lt;BR /&gt;But there was a typo and it disregarded the amount of count.&lt;BR /&gt;Added a sort to your solution.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| stats count by user
| sort - count
| eventstats count as total
| streamstats count as current
| where current&amp;lt;=0.15*total&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 Nov 2023 14:47:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667902#M229154</guid>
      <dc:creator>FelixLeh</dc:creator>
      <dc:date>2023-11-08T14:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit search results to * % of all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667904#M229156</link>
      <description>&lt;P&gt;What is your way of sorting, groupping, ordering and so on is up to you. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;"My" part only did the limiting.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 14:54:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667904#M229156</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-11-08T14:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit search results to * % of all results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667912#M229158</link>
      <description>&lt;P&gt;Thanks both of you guys!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 15:21:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-search-results-to-of-all-results/m-p/667912#M229158</guid>
      <dc:creator>kk2204</dc:creator>
      <dc:date>2023-11-08T15:21:02Z</dc:date>
    </item>
  </channel>
</rss>

