<?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 Why I get &amp;quot;error code 1&amp;quot; ? in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/Why-I-get-quot-error-code-1-quot/m-p/37003#M6889</link>
    <description>&lt;P&gt;I created a custom search command called my_formula.py. When I run the script in my command prompt, everything works fine.  Then I run it in Splunk search bar, it shows "External search command 'my_formula' returned error code 1".&lt;/P&gt;

&lt;P&gt;I tried to check what is the exact error with below command:&lt;BR /&gt;
index=_internal sourcetype=splunkd ExecProcessor&lt;/P&gt;

&lt;P&gt;But I just get nothing. Does anybody know how to view the stdout or stdin message in Splunk? Please help.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:35:15 GMT</pubDate>
    <dc:creator>cycheng</dc:creator>
    <dc:date>2020-09-28T14:35:15Z</dc:date>
    <item>
      <title>Why I get "error code 1" ?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Why-I-get-quot-error-code-1-quot/m-p/37003#M6889</link>
      <description>&lt;P&gt;I created a custom search command called my_formula.py. When I run the script in my command prompt, everything works fine.  Then I run it in Splunk search bar, it shows "External search command 'my_formula' returned error code 1".&lt;/P&gt;

&lt;P&gt;I tried to check what is the exact error with below command:&lt;BR /&gt;
index=_internal sourcetype=splunkd ExecProcessor&lt;/P&gt;

&lt;P&gt;But I just get nothing. Does anybody know how to view the stdout or stdin message in Splunk? Please help.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:35:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Why-I-get-quot-error-code-1-quot/m-p/37003#M6889</guid>
      <dc:creator>cycheng</dc:creator>
      <dc:date>2020-09-28T14:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why I get "error code 1" ?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Why-I-get-quot-error-code-1-quot/m-p/37004#M6890</link>
      <description>&lt;P&gt;Are you utilizing python that comes with the OS or the one that comes with Splunk?  Try running your script like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$SPLUNK_HOME/bin/splunk cmd python my_formula.py
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should run it with the Splunk python distribution.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2013 05:34:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Why-I-get-quot-error-code-1-quot/m-p/37004#M6890</guid>
      <dc:creator>sbrant_splunk</dc:creator>
      <dc:date>2013-08-16T05:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why I get "error code 1" ?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Why-I-get-quot-error-code-1-quot/m-p/37005#M6891</link>
      <description>&lt;P&gt;Thanks for your answer. My first line of script is&lt;BR /&gt;
results,unused1,unused2 = splunk.Intersplunk.getOrganizedResults()&lt;/P&gt;

&lt;P&gt;The script should get the search results before proceed:&lt;BR /&gt;
index=my_index | my_formula&lt;/P&gt;

&lt;P&gt;May I know how can I pass the search results through command above? I tried below command and it is not working also:&lt;BR /&gt;
splunk search "index=my_index | my_formula"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:35:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Why-I-get-quot-error-code-1-quot/m-p/37005#M6891</guid>
      <dc:creator>cycheng</dc:creator>
      <dc:date>2020-09-28T14:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why I get "error code 1" ?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Why-I-get-quot-error-code-1-quot/m-p/37006#M6892</link>
      <description>&lt;P&gt;I get my answer from &lt;A href="http://answers.splunk.com/answers/62473/how-to-execute-external-script-to-manipulate-file-from-search-command"&gt;http://answers.splunk.com/answers/62473/how-to-execute-external-script-to-manipulate-file-from-search-command&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;try:
  :
except:
   import traceback
   stack =  traceback.format_exc()
   results = splunk.Intersplunk.generateErrorResults("Error : Traceback: " + str(stack))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Aug 2013 06:59:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Why-I-get-quot-error-code-1-quot/m-p/37006#M6892</guid>
      <dc:creator>cycheng</dc:creator>
      <dc:date>2013-08-16T06:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why I get "error code 1" ?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Why-I-get-quot-error-code-1-quot/m-p/37007#M6893</link>
      <description>&lt;P&gt;See my answer&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/145246/external-search-command-mypythonfile-returned-error-code-1-after-splunk-upgrade.html"&gt;https://answers.splunk.com/answers/145246/external-search-command-mypythonfile-returned-error-code-1-after-splunk-upgrade.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 02:26:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Why-I-get-quot-error-code-1-quot/m-p/37007#M6893</guid>
      <dc:creator>praveenkpatidar</dc:creator>
      <dc:date>2016-10-06T02:26:52Z</dc:date>
    </item>
  </channel>
</rss>

