<?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 100 result limit in JS SDK in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/100-result-limit-in-JS-SDK/m-p/96181#M24839</link>
    <description>&lt;P&gt;I tried adding "count" to params object when calling service.search() but it doesn't work. How do I get more than 100 results from the api when using the javascript SDK?&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jul 2012 23:26:49 GMT</pubDate>
    <dc:creator>LordVoldemort</dc:creator>
    <dc:date>2012-07-11T23:26:49Z</dc:date>
    <item>
      <title>100 result limit in JS SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/100-result-limit-in-JS-SDK/m-p/96181#M24839</link>
      <description>&lt;P&gt;I tried adding "count" to params object when calling service.search() but it doesn't work. How do I get more than 100 results from the api when using the javascript SDK?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2012 23:26:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/100-result-limit-in-JS-SDK/m-p/96181#M24839</guid>
      <dc:creator>LordVoldemort</dc:creator>
      <dc:date>2012-07-11T23:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: 100 result limit in JS SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/100-result-limit-in-JS-SDK/m-p/96182#M24840</link>
      <description>&lt;P&gt;I am far from expert on this. But I can quote some information I have from an expert:&lt;/P&gt;

&lt;P&gt;The maximum number of results is always going to be the value in &lt;CODE&gt;max_count&lt;/CODE&gt; (which you can set when you create the search). The maximum number of events is going to be max_count * status_buckets, which you can also set when you create the search.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:03:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/100-result-limit-in-JS-SDK/m-p/96182#M24840</guid>
      <dc:creator>ChrisG</dc:creator>
      <dc:date>2020-09-28T12:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: 100 result limit in JS SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/100-result-limit-in-JS-SDK/m-p/96183#M24841</link>
      <description>&lt;P&gt;Great question. There are a couple of different limits on how to get more data from a Splunk search, but I'll only go over the important ones here.&lt;/P&gt;

&lt;P&gt;When you create a search, you can specify how many status buckets this search can have, and how many events/results should be stored per status bucket. The default is 10,000 per status bucket, and the default number of status buckets is 0. So if you did a search with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;service.search("query", function(...) { ... })
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The maximum number of results you can get back is 10,000. If you instead did:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;service.search("query", {status_buckets: 300}, function(...) { ... })
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You would get a maximum of 300 * 10,000 results stored. Note that 300 is the default value used by the UI. You could also pass in something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{max_count: 50000}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and that will similarly change things.&lt;/P&gt;

&lt;P&gt;However, even with setting &lt;CODE&gt;max_count&lt;/CODE&gt;/&lt;CODE&gt;status_buckets&lt;/CODE&gt;, the default number of results you get back when you do something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mySearchJob.results({}, function(err, results) { ... })
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;is going to be 100, per the REST API documentation (&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.3/RESTAPI/RESTsearch#search.2Fjobs.2F.7Bsearch_id.7D.2Fresults"&gt;here&lt;/A&gt;). You can pass in a &lt;CODE&gt;count&lt;/CODE&gt; parameter to override this, as such:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mySearchJob.results({count: 500}, function(err, results) { ... })
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and this will fetch 500 results at a time. You can also paginate through the results by using a combination of &lt;CODE&gt;count&lt;/CODE&gt; and &lt;CODE&gt;offset&lt;/CODE&gt;, e.g.:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mySearchJob.results({count: 500, offset: 1000}, function(err, results) { ... })
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Finally, the maximum number of results you can get in a &lt;EM&gt;single&lt;/EM&gt; call to the &lt;CODE&gt;search/jobs/{sid}/results&lt;/CODE&gt; endpoint (which is what &lt;CODE&gt;mySearchJob.results(...)&lt;/CODE&gt; is calling under the hood) is defined by the &lt;CODE&gt;maxresultsrows&lt;/CODE&gt; value in &lt;CODE&gt;limits.conf&lt;/CODE&gt; (in the &lt;CODE&gt;restapi&lt;/CODE&gt; stanza). This is by default 50,000. Note that you can retrieve more than 50,000 results from a single search, you just have to do it using multiple API calls (i.e. pagination). You can see a sample of this &lt;A href="http://dev.splunk.com/view/SP-CAAAECN#components"&gt;here&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Hopefully this makes sense. If not, let me know, and I'll clarify some more! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2012 01:07:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/100-result-limit-in-JS-SDK/m-p/96183#M24841</guid>
      <dc:creator>ineeman</dc:creator>
      <dc:date>2012-07-12T01:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: 100 result limit in JS SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/100-result-limit-in-JS-SDK/m-p/96184#M24842</link>
      <description>&lt;P&gt;Thanks for the thorough response.&lt;/P&gt;

&lt;P&gt;In this case, putting count in the call to job.results() was all I needed.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2012 16:40:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/100-result-limit-in-JS-SDK/m-p/96184#M24842</guid>
      <dc:creator>LordVoldemort</dc:creator>
      <dc:date>2012-07-12T16:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: 100 result limit in JS SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Search/100-result-limit-in-JS-SDK/m-p/96185#M24843</link>
      <description>&lt;P&gt;I think these comments about status buckets only apply if the search has no transforming commands. Status buckets are relevant really only to the streaming portion of the search.   Just fyi.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2012 03:13:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/100-result-limit-in-JS-SDK/m-p/96185#M24843</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2012-07-20T03:13:22Z</dc:date>
    </item>
  </channel>
</rss>

