<?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: Scripted Input failing, runs fine when run manually in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Scripted-Input-failing-runs-fine-when-run-manually/m-p/46862#M11192</link>
    <description>&lt;P&gt;Is $SPLUNK_HOME/var/log/splunk/splunkd.log reporting any errors when it runs?&lt;/P&gt;

&lt;P&gt;I think the script needs to be under $SPLUNK_HOME/bin/scripts..&lt;/P&gt;

&lt;P&gt;Brian&lt;/P&gt;</description>
    <pubDate>Fri, 10 Sep 2010 00:24:02 GMT</pubDate>
    <dc:creator>Brian_Osburn</dc:creator>
    <dc:date>2010-09-10T00:24:02Z</dc:date>
    <item>
      <title>Scripted Input failing, runs fine when run manually</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Scripted-Input-failing-runs-fine-when-run-manually/m-p/46861#M11191</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a scriped input that is throwing an error:&lt;/P&gt;

&lt;P&gt;ERROR ExecProcessor - message from ""MyScript.bat"" python: can't open file 'MyScript.py': [Errno 2] No such file or directory&lt;/P&gt;

&lt;P&gt;However, when I log into that server, run the batch file from the command line, it runs just fine.  The batch file looks like this:&lt;/P&gt;

&lt;P&gt;@echo off 
"PATH_TO_SPLUNK.EXE\splunk.exe" cmd python MyScript.py&lt;/P&gt;

&lt;P&gt;This runs in the etc/apps/myscriptapp/bin&lt;/P&gt;

&lt;P&gt;Does anyone know whey the batch file would run just fine when executed from the cmd line and not from within Splunk?&lt;/P&gt;

&lt;P&gt;Thanks for any help.&lt;/P&gt;

&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2010 23:04:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Scripted-Input-failing-runs-fine-when-run-manually/m-p/46861#M11191</guid>
      <dc:creator>kholleran</dc:creator>
      <dc:date>2010-09-09T23:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input failing, runs fine when run manually</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Scripted-Input-failing-runs-fine-when-run-manually/m-p/46862#M11192</link>
      <description>&lt;P&gt;Is $SPLUNK_HOME/var/log/splunk/splunkd.log reporting any errors when it runs?&lt;/P&gt;

&lt;P&gt;I think the script needs to be under $SPLUNK_HOME/bin/scripts..&lt;/P&gt;

&lt;P&gt;Brian&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2010 00:24:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Scripted-Input-failing-runs-fine-when-run-manually/m-p/46862#M11192</guid>
      <dc:creator>Brian_Osburn</dc:creator>
      <dc:date>2010-09-10T00:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input failing, runs fine when run manually</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Scripted-Input-failing-runs-fine-when-run-manually/m-p/46863#M11193</link>
      <description>&lt;P&gt;I ended up putting the whole path in the MyScript.py section instead of the relative path.&lt;/P&gt;

&lt;P&gt;@echo off 
"PATH_TO_SPLUNK.EXE\splunk.exe" cmd python "PATH_TO_SCRIPT\MyScript.py"&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2010 00:31:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Scripted-Input-failing-runs-fine-when-run-manually/m-p/46863#M11193</guid>
      <dc:creator>kholleran</dc:creator>
      <dc:date>2010-09-10T00:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input failing, runs fine when run manually</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Scripted-Input-failing-runs-fine-when-run-manually/m-p/46864#M11194</link>
      <description>&lt;P&gt;Doh!  I've had that happen too..&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2010 00:50:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Scripted-Input-failing-runs-fine-when-run-manually/m-p/46864#M11194</guid>
      <dc:creator>Brian_Osburn</dc:creator>
      <dc:date>2010-09-10T00:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input failing, runs fine when run manually</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Scripted-Input-failing-runs-fine-when-run-manually/m-p/46865#M11195</link>
      <description>&lt;P&gt;&lt;CODE&gt;splunk cmd&lt;/CODE&gt; has special behavior for running executables, (it looks in a particular directory) but python doesn't.  Python myscript.py will look in the current directory, wherever that is.  I recommend using the environment.  For a batch file, &lt;CODE&gt;%SPLUNK_HOME%\etc\apps\myapp\bin\foo.py&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2010 01:21:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Scripted-Input-failing-runs-fine-when-run-manually/m-p/46865#M11195</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2010-09-10T01:21:47Z</dc:date>
    </item>
  </channel>
</rss>

