<?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: Pyton SDK custom command runing distributed instead of local only in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Pyton-SDK-custom-command-runing-distributed-instead-of-local/m-p/544221#M9739</link>
    <description>&lt;P data-unlink="true"&gt;By "above" I meant "&lt;SPAN class=""&gt;fk319&amp;nbsp;'s post" - sorry.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Mar 2021 15:33:34 GMT</pubDate>
    <dc:creator>thellmann</dc:creator>
    <dc:date>2021-03-17T15:33:34Z</dc:date>
    <item>
      <title>Pyton SDK custom command runing distributed instead of local only</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Pyton-SDK-custom-command-runing-distributed-instead-of-local/m-p/543505#M9736</link>
      <description>&lt;P&gt;I have written a generating custom command which generates just one event containing the session token and the search head it runs. This two parameters are then passed to another custom command which runs distributed on the indexers and needs them to call back to the search head.&lt;BR /&gt;&lt;BR /&gt;I am on Splunk Enterprise, Version: 8.0.3 with Splunk Python SDK 1.6.12, single search head and 96 node indexer cluster.&lt;/P&gt;&lt;P&gt;The python script of the command starts with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from __future__ import absolute_import, division, print_function, unicode_literals

import os,sys
import time

splunkhome = os.environ['SPLUNK_HOME']
sys.path.append(os.path.join(splunkhome, 'etc', 'apps', 'searchcommands_app', 'lib'))
from splunklib.searchcommands import dispatch, GeneratingCommand, Configuration, Option, validators


@Configuration(streaming=True, local=True)
class callbackconnection(GeneratingCommand): 
 .......&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The definition of the command in commands.conf is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[callbackconnection]
filename = callbackconnection.py
# python.version=python3
chunked = true&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This command runs fine while using python 2.x but as soon as python.version=python3 is active in the definition of the command in commands.conf, the command gets distributed to the indexers an returns 97 results.&lt;BR /&gt;&lt;BR /&gt;I tried various&amp;nbsp; @configuration(....) settings, but with python 3 the command is always distributed to the indexers.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 08:53:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Pyton-SDK-custom-command-runing-distributed-instead-of-local/m-p/543505#M9736</guid>
      <dc:creator>FritzWittwer</dc:creator>
      <dc:date>2021-03-12T08:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Pyton SDK custom command runing distributed instead of local only</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Pyton-SDK-custom-command-runing-distributed-instead-of-local/m-p/544063#M9737</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/DocumentationStatic/PythonSDK/1.6.13/searchcommands.html#splunklib.searchcommands.GeneratingCommand" target="_blank"&gt;https://docs.splunk.com/DocumentationStatic/PythonSDK/1.6.13/searchcommands.html#splunklib.searchcommands.GeneratingCommand&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The command changed from "local" to "distributed".&lt;BR /&gt;Good luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 19:34:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Pyton-SDK-custom-command-runing-distributed-instead-of-local/m-p/544063#M9737</guid>
      <dc:creator>fk319</dc:creator>
      <dc:date>2021-03-16T19:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Pyton SDK custom command runing distributed instead of local only</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Pyton-SDK-custom-command-runing-distributed-instead-of-local/m-p/544220#M9738</link>
      <description>&lt;P&gt;In addition to the above, I would recommend updating to 1.6.14+ of the Splunk Enterprise SDK for Python, since there are specific fixes for custom search commands in that version.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 15:32:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Pyton-SDK-custom-command-runing-distributed-instead-of-local/m-p/544220#M9738</guid>
      <dc:creator>thellmann</dc:creator>
      <dc:date>2021-03-17T15:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Pyton SDK custom command runing distributed instead of local only</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Pyton-SDK-custom-command-runing-distributed-instead-of-local/m-p/544221#M9739</link>
      <description>&lt;P data-unlink="true"&gt;By "above" I meant "&lt;SPAN class=""&gt;fk319&amp;nbsp;'s post" - sorry.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 15:33:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Pyton-SDK-custom-command-runing-distributed-instead-of-local/m-p/544221#M9739</guid>
      <dc:creator>thellmann</dc:creator>
      <dc:date>2021-03-17T15:33:34Z</dc:date>
    </item>
  </channel>
</rss>

