<?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: Is it possible to make an mvexpand in custom python search function? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Is-it-possible-to-make-an-mvexpand-in-custom-python-search/m-p/184661#M2464</link>
    <description>&lt;P&gt;That doesn't help at all, sorry, I was asking on how to make a mvexpand in my code... not how to retrieve Data...&lt;/P&gt;

&lt;P&gt;Let say, I'm reading a line, and I want to duplicate this line x-time, to expand the values from one field (what mvexpand make in the search command, but I need to make it in the script)&lt;/P&gt;</description>
    <pubDate>Mon, 18 Aug 2014 13:37:08 GMT</pubDate>
    <dc:creator>sbsbb</dc:creator>
    <dc:date>2014-08-18T13:37:08Z</dc:date>
    <item>
      <title>Is it possible to make an mvexpand in custom python search function?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-it-possible-to-make-an-mvexpand-in-custom-python-search/m-p/184659#M2462</link>
      <description>&lt;P&gt;I would like to make a streamable custom function, that get some xml message :&lt;/P&gt;

&lt;P&gt;index=* parameter1=2 | myCustomFunction&lt;/P&gt;

&lt;P&gt;This function should read the content of field1, and for each element write a new line.&lt;BR /&gt;
Is it possible to make an "mvexpand" in my custom python search function ? Can I add a result event ?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Aug 2014 08:17:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-it-possible-to-make-an-mvexpand-in-custom-python-search/m-p/184659#M2462</guid>
      <dc:creator>sbsbb</dc:creator>
      <dc:date>2014-08-16T08:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to make an mvexpand in custom python search function?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-it-possible-to-make-an-mvexpand-in-custom-python-search/m-p/184660#M2463</link>
      <description>&lt;P&gt;Hi sbsbb,&lt;/P&gt;

&lt;P&gt;yes, this is possible within your script. You need to load the following Splunk Python module &lt;CODE&gt;splunk.Intersplunk&lt;/CODE&gt; and use &lt;CODE&gt;splunk.Intersplunk.getOrganizedResults()&lt;/CODE&gt; to recieve key=value pairs from the previous results.&lt;/P&gt;

&lt;P&gt;This means, if your base search returns &lt;CODE&gt;field1=foo&lt;/CODE&gt; your script can then use this key &lt;CODE&gt;field1&lt;/CODE&gt; and its value of &lt;CODE&gt;foo&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;As always, docs is a good place to start &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/AdvancedDev/Searchscripts"&gt;Custom search commands&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;hope this helps to get you started ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2014 10:44:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-it-possible-to-make-an-mvexpand-in-custom-python-search/m-p/184660#M2463</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-08-18T10:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to make an mvexpand in custom python search function?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-it-possible-to-make-an-mvexpand-in-custom-python-search/m-p/184661#M2464</link>
      <description>&lt;P&gt;That doesn't help at all, sorry, I was asking on how to make a mvexpand in my code... not how to retrieve Data...&lt;/P&gt;

&lt;P&gt;Let say, I'm reading a line, and I want to duplicate this line x-time, to expand the values from one field (what mvexpand make in the search command, but I need to make it in the script)&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2014 13:37:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-it-possible-to-make-an-mvexpand-in-custom-python-search/m-p/184661#M2464</guid>
      <dc:creator>sbsbb</dc:creator>
      <dc:date>2014-08-18T13:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to make an mvexpand in custom python search function?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-it-possible-to-make-an-mvexpand-in-custom-python-search/m-p/184662#M2465</link>
      <description>&lt;P&gt;okay, completely miss understood the question in this case &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Still, if you want to write a custom command that reads something from events ( like &lt;CODE&gt;mvexpand&lt;/CODE&gt; does ) your custom command script needs the splunk.Intersplunk module to be loaded.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2014 13:46:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-it-possible-to-make-an-mvexpand-in-custom-python-search/m-p/184662#M2465</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-08-18T13:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to make an mvexpand in custom python search function?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Is-it-possible-to-make-an-mvexpand-in-custom-python-search/m-p/184663#M2466</link>
      <description>&lt;P&gt;I know that...&lt;BR /&gt;
In fact I was not aware that I can simply just append many row to the results (thats what mvexpand make) :&lt;BR /&gt;
        for result in results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        out_results.append(result)
        out_results.append(result)  

    si.outputResults(out_results)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Aug 2014 14:54:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Is-it-possible-to-make-an-mvexpand-in-custom-python-search/m-p/184663#M2466</guid>
      <dc:creator>sbsbb</dc:creator>
      <dc:date>2014-08-25T14:54:27Z</dc:date>
    </item>
  </channel>
</rss>

