<?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 troubleshoot why my basic custom Python command is not working? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-troubleshoot-why-my-basic-custom-Python-command-is-not/m-p/283835#M3542</link>
    <description>&lt;P&gt;I would like to develop a python custom search command. At this time, my script does nothing but generates errors.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Here is the script monitor.py (located in Splunk/etc/apps/HOME_COM/bin):&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import splunk.Intersplunk as si
results = si.getOrganizedResults()
si.outputResults(results)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;In Splunk/etc/apps/HOME_COM/local/commands.conf I added&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitore]
filename = monitore.py
streaming = true
enableheader = true
run_in_preview = true
local = false
retainsevents = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Then in my app : HOME_COM&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; * |head 10|monitore
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I systematically get the following error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;External search command 'monitore' returned error code 1.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;I found also in Activity-&amp;gt;System activity-&amp;gt; Internal Errors and Messages the following error that occurs each time I call the "&lt;EM&gt;monitore&lt;/EM&gt;" command.&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10-19-2015 21:41:37.557 +0200 ERROR ExecProcessor - message from "/Applications/Splunk/etc/apps/routemap/bin/launch_app.sh" /bin/sh: /Applications/Splunk/etc/apps/routemap/bin/launch_app.sh: Permission denied
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Tue, 20 Oct 2015 05:15:56 GMT</pubDate>
    <dc:creator>clorne</dc:creator>
    <dc:date>2015-10-20T05:15:56Z</dc:date>
    <item>
      <title>How to troubleshoot why my basic custom Python command is not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-troubleshoot-why-my-basic-custom-Python-command-is-not/m-p/283835#M3542</link>
      <description>&lt;P&gt;I would like to develop a python custom search command. At this time, my script does nothing but generates errors.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Here is the script monitor.py (located in Splunk/etc/apps/HOME_COM/bin):&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import splunk.Intersplunk as si
results = si.getOrganizedResults()
si.outputResults(results)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;In Splunk/etc/apps/HOME_COM/local/commands.conf I added&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitore]
filename = monitore.py
streaming = true
enableheader = true
run_in_preview = true
local = false
retainsevents = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Then in my app : HOME_COM&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; * |head 10|monitore
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I systematically get the following error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;External search command 'monitore' returned error code 1.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;I found also in Activity-&amp;gt;System activity-&amp;gt; Internal Errors and Messages the following error that occurs each time I call the "&lt;EM&gt;monitore&lt;/EM&gt;" command.&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10-19-2015 21:41:37.557 +0200 ERROR ExecProcessor - message from "/Applications/Splunk/etc/apps/routemap/bin/launch_app.sh" /bin/sh: /Applications/Splunk/etc/apps/routemap/bin/launch_app.sh: Permission denied
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 05:15:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-troubleshoot-why-my-basic-custom-Python-command-is-not/m-p/283835#M3542</guid>
      <dc:creator>clorne</dc:creator>
      <dc:date>2015-10-20T05:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to troubleshoot why my basic custom Python command is not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-troubleshoot-why-my-basic-custom-Python-command-is-not/m-p/283836#M3543</link>
      <description>&lt;P&gt;Hi clorne,&lt;/P&gt;

&lt;P&gt;For better troubleshooting, take a look at the docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.0/AdvancedDev/ModInputsLog"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.0/AdvancedDev/ModInputsLog&lt;/A&gt; to add some error logging features in your script and find the errors either in &lt;CODE&gt;index=_internal ExecProcessor&lt;/CODE&gt; or &lt;CODE&gt;splunkd.log&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;The other error is not related to your script, it's from the routemap app - but you have the wrong permission on it; probably &lt;CODE&gt;x&lt;/CODE&gt; bit missing.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 08:28:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-troubleshoot-why-my-basic-custom-Python-command-is-not/m-p/283836#M3543</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-10-20T08:28:21Z</dc:date>
    </item>
  </channel>
</rss>

