<?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 Streamable command can return more than one row? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Streamable-command-can-return-more-than-one-row/m-p/502154#M8998</link>
    <description>&lt;P&gt;Hello, I'm creating a custom command on splunk (as you can see bellow), my problem is that from one row I want to create two.&lt;/P&gt;

&lt;P&gt;Is it possible? &lt;/P&gt;

&lt;P&gt;Just to keep you in the context, what i'm trying to change this single line:&lt;BR /&gt;
main_app          first_relation          second_relation&lt;/P&gt;

&lt;P&gt;into two:&lt;BR /&gt;
main_app          first_relation&lt;BR /&gt;
main_app          second_relation&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import sys
import re
from splunklib.searchcommands import dispatch, StreamingCommand, Configuration


@Configuration(local=True)
class ExtractDicom(StreamingCommand):
    def stream(self, records):
        for record in records:
            record['from'] = None
            record['to'] = None
            if record['main_app'] is not None or record['main_app']!='':
                record['from'] = record['main_app']
                record['to'] = record['first_relation']
                record['from'] = record['main_app']
                record['to'] = record['second_relation']

            record['meh'] = {'data2', 'data3'}

            yield record


if __name__ == "__main__":
    dispatch(ExtractDicom, sys.argv, sys.stdin, sys.stdout, __name__)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any kind of help I would appreciate &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 02:32:54 GMT</pubDate>
    <dc:creator>ppatrikfr</dc:creator>
    <dc:date>2020-09-30T02:32:54Z</dc:date>
    <item>
      <title>Streamable command can return more than one row?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Streamable-command-can-return-more-than-one-row/m-p/502154#M8998</link>
      <description>&lt;P&gt;Hello, I'm creating a custom command on splunk (as you can see bellow), my problem is that from one row I want to create two.&lt;/P&gt;

&lt;P&gt;Is it possible? &lt;/P&gt;

&lt;P&gt;Just to keep you in the context, what i'm trying to change this single line:&lt;BR /&gt;
main_app          first_relation          second_relation&lt;/P&gt;

&lt;P&gt;into two:&lt;BR /&gt;
main_app          first_relation&lt;BR /&gt;
main_app          second_relation&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import sys
import re
from splunklib.searchcommands import dispatch, StreamingCommand, Configuration


@Configuration(local=True)
class ExtractDicom(StreamingCommand):
    def stream(self, records):
        for record in records:
            record['from'] = None
            record['to'] = None
            if record['main_app'] is not None or record['main_app']!='':
                record['from'] = record['main_app']
                record['to'] = record['first_relation']
                record['from'] = record['main_app']
                record['to'] = record['second_relation']

            record['meh'] = {'data2', 'data3'}

            yield record


if __name__ == "__main__":
    dispatch(ExtractDicom, sys.argv, sys.stdin, sys.stdout, __name__)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any kind of help I would appreciate &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:32:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Streamable-command-can-return-more-than-one-row/m-p/502154#M8998</guid>
      <dc:creator>ppatrikfr</dc:creator>
      <dc:date>2020-09-30T02:32:54Z</dc:date>
    </item>
  </channel>
</rss>

