<?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: Preview generating custom command result in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Preview-generating-custom-command-result/m-p/398208#M115509</link>
    <description>&lt;P&gt;So you actually solved the problem? I'm trying the same thing using SCPv2 and it still waits for all 1M results before showing them in preview. Same configuration settings and CSC.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2019 14:59:16 GMT</pubDate>
    <dc:creator>kcnolan13</dc:creator>
    <dc:date>2019-10-21T14:59:16Z</dc:date>
    <item>
      <title>Preview generating custom command result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Preview-generating-custom-command-result/m-p/398206#M115507</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I want to add a generating custom command that will query one of our DBs. So I have followed the tutorials and created a class that inherits from  &lt;CODE&gt;GeneratingCommand&lt;/CODE&gt; and implemented the  &lt;CODE&gt;generate&lt;/CODE&gt; method. Problem is that Splunk waits for &lt;STRONG&gt;all&lt;/STRONG&gt; the results to return and the query might be slow (4-5 seconds). So following some of the docs it looks like  &lt;CODE&gt;timeline_events_preview&lt;/CODE&gt; is what I need but I still don't get the live update of the events view (Similar to using the builtin  &lt;CODE&gt;search&lt;/CODE&gt; command).&lt;/P&gt;

&lt;P&gt;I can't post the original code (for copyright reasons) but I can't make it work even with the next simple example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;@Configuration(streaming=True)
class MyGeneratingCommand(GeneratingCommand):
    def generate(self):
        for i in range(10 ** 6):
            yield {'_time': time.time(), '_raw': 'test {}'.format(i), 'events_no': i}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I added a  &lt;CODE&gt;limits.conf&lt;/CODE&gt; file to &lt;CODE&gt;$SPLUNK_HOME/etc/apps/myapp/local&lt;/CODE&gt; with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[search]
timeline_events_preview = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I use the custom command Splunk waits for all 1 million results to return before showing some of them in the events view.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 09:34:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Preview-generating-custom-command-result/m-p/398206#M115507</guid>
      <dc:creator>electronicsplun</dc:creator>
      <dc:date>2018-11-20T09:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Preview generating custom command result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Preview-generating-custom-command-result/m-p/398207#M115508</link>
      <description>&lt;P&gt;So my problem was that I used the SCPv1 instead of using SCPv2 that supports the &lt;CODE&gt;chunked&lt;/CODE&gt;. This property of the SCPv2 should be documented more because I didn't find any explicit and clear description of the differences between v1 and v2. &lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 14:19:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Preview-generating-custom-command-result/m-p/398207#M115508</guid>
      <dc:creator>electronicsplun</dc:creator>
      <dc:date>2018-11-25T14:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Preview generating custom command result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Preview-generating-custom-command-result/m-p/398208#M115509</link>
      <description>&lt;P&gt;So you actually solved the problem? I'm trying the same thing using SCPv2 and it still waits for all 1M results before showing them in preview. Same configuration settings and CSC.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 14:59:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Preview-generating-custom-command-result/m-p/398208#M115509</guid>
      <dc:creator>kcnolan13</dc:creator>
      <dc:date>2019-10-21T14:59:16Z</dc:date>
    </item>
  </channel>
</rss>

