<?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 How to reduce custom search command result chunk size? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-reduce-custom-search-command-result-chunk-size/m-p/533573#M9603</link>
    <description>&lt;P&gt;We are developing a custom search command to create events, this is using a streaming command with version 2 of the protocol, as the source is quite slow we'd like to send smaller chunks of results back to Splunk than the default 50,000, e.g. chunks of 1,000 events, so that users can view the partial results sooner.&lt;/P&gt;
&lt;P&gt;We've tried various approaches including an incrementing integar and calling self.flush() when it is divisable by 1,000, but that caused a buffer full error.&lt;/P&gt;
&lt;P&gt;Any suggestions would be really appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;...
@Configuration(type='streaming')
class OurSearchCommand(GeneratingCommand):
    ...
    for item in OurGenerator():
        item['_time'] = item['timestamp']
        yield item&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2023 21:13:58 GMT</pubDate>
    <dc:creator>joepjisc</dc:creator>
    <dc:date>2023-06-06T21:13:58Z</dc:date>
    <item>
      <title>How to reduce custom search command result chunk size?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-reduce-custom-search-command-result-chunk-size/m-p/533573#M9603</link>
      <description>&lt;P&gt;We are developing a custom search command to create events, this is using a streaming command with version 2 of the protocol, as the source is quite slow we'd like to send smaller chunks of results back to Splunk than the default 50,000, e.g. chunks of 1,000 events, so that users can view the partial results sooner.&lt;/P&gt;
&lt;P&gt;We've tried various approaches including an incrementing integar and calling self.flush() when it is divisable by 1,000, but that caused a buffer full error.&lt;/P&gt;
&lt;P&gt;Any suggestions would be really appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;...
@Configuration(type='streaming')
class OurSearchCommand(GeneratingCommand):
    ...
    for item in OurGenerator():
        item['_time'] = item['timestamp']
        yield item&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 21:13:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-reduce-custom-search-command-result-chunk-size/m-p/533573#M9603</guid>
      <dc:creator>joepjisc</dc:creator>
      <dc:date>2023-06-06T21:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reduce Custom Search Command Result Chunk Size</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-reduce-custom-search-command-result-chunk-size/m-p/645992#M11089</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;I know this is an old question, but for anyone else looking for the answer you need to overwrite the record_writer for the class. This is working for me, but I am not sure if there are any other implications of doing this.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;self._record_writer._maxresultrows = 1000 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 18:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-reduce-custom-search-command-result-chunk-size/m-p/645992#M11089</guid>
      <dc:creator>DexterMarkley</dc:creator>
      <dc:date>2023-06-06T18:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Reduce Custom Search Command Result Chunk Size</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-reduce-custom-search-command-result-chunk-size/m-p/658202#M11178</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257490"&gt;@DexterMarkley&lt;/a&gt;&amp;nbsp; may you provide the location of file needed to be changes?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 02:17:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-reduce-custom-search-command-result-chunk-size/m-p/658202#M11178</guid>
      <dc:creator>analyst</dc:creator>
      <dc:date>2023-09-21T02:17:29Z</dc:date>
    </item>
  </channel>
</rss>

