<?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: maxresults and stats command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/maxresults-and-stats-command/m-p/9896#M294</link>
    <description>&lt;P&gt;What's the particular command you are running? Yes, the results are accurate over all events for the buckets that are displayed, but only &lt;EM&gt;displays&lt;/EM&gt; up to 10,000 rows.&lt;/P&gt;

&lt;P&gt;For example, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count by id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;might only list 10,000 entries, but each &lt;CODE&gt;count&lt;/CODE&gt; value will be accurate for all events. Furthermore,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count by id | stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will give you the correct number of distinct &lt;CODE&gt;id&lt;/CODE&gt;'s even if it's more than 10,000, and&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count by id | stats sum(count)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will give you the correct total number of events with an &lt;CODE&gt;id&lt;/CODE&gt;, not just the sum of the first 10,000. (Of course there are other ways to compute these values, but the point is that the limit only affects the total number of final results displayed in the web UI.)&lt;/P&gt;

&lt;P&gt;Finally, running&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count by id | outputcsv myoutfile
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will write the output file &lt;CODE&gt;$SPLUNK_HOME/var/run/splunk/myoutfile.csv&lt;/CODE&gt; with the entire set of results, even though only 10,000 are displayed in the web interface.&lt;/P&gt;</description>
    <pubDate>Sat, 27 Feb 2010 07:37:00 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2010-02-27T07:37:00Z</dc:date>
    <item>
      <title>maxresults and stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/maxresults-and-stats-command/m-p/9895#M293</link>
      <description>&lt;P&gt;Does maxresults in limits.conf have an effect when piping results to the stats command?  For example, if I run a search over 15 minutes Splunk says there are 523,107 results between 9:00am and 9:15, however only 1000 pages (10 results/page) of results are displayed in the web gui, so 10,000 results, which matches the value in limits.conf.  Does the stats command report across all 523,107 results or only the 10,000 that are displayed in the web gui?&lt;/P&gt;

&lt;P&gt;Thanks in advance for any help.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2010 03:27:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/maxresults-and-stats-command/m-p/9895#M293</guid>
      <dc:creator>kbecker</dc:creator>
      <dc:date>2010-02-27T03:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: maxresults and stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/maxresults-and-stats-command/m-p/9896#M294</link>
      <description>&lt;P&gt;What's the particular command you are running? Yes, the results are accurate over all events for the buckets that are displayed, but only &lt;EM&gt;displays&lt;/EM&gt; up to 10,000 rows.&lt;/P&gt;

&lt;P&gt;For example, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count by id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;might only list 10,000 entries, but each &lt;CODE&gt;count&lt;/CODE&gt; value will be accurate for all events. Furthermore,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count by id | stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will give you the correct number of distinct &lt;CODE&gt;id&lt;/CODE&gt;'s even if it's more than 10,000, and&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count by id | stats sum(count)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will give you the correct total number of events with an &lt;CODE&gt;id&lt;/CODE&gt;, not just the sum of the first 10,000. (Of course there are other ways to compute these values, but the point is that the limit only affects the total number of final results displayed in the web UI.)&lt;/P&gt;

&lt;P&gt;Finally, running&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | stats count by id | outputcsv myoutfile
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will write the output file &lt;CODE&gt;$SPLUNK_HOME/var/run/splunk/myoutfile.csv&lt;/CODE&gt; with the entire set of results, even though only 10,000 are displayed in the web interface.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2010 07:37:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/maxresults-and-stats-command/m-p/9896#M294</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-02-27T07:37:00Z</dc:date>
    </item>
  </channel>
</rss>

