I have a scriped input that is throwing an error:
ERROR ExecProcessor - message from ""MyScript.bat"" python: can't open file 'MyScript.py': [Errno 2] No such file or directory
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:
@echo off "PATH_TO_SPLUNK.EXE\splunk.exe" cmd python MyScript.py
This runs in the etc/apps/myscriptapp/bin
Does anyone know whey the batch file would run just fine when executed from the cmd line and not from within Splunk?
Thanks for any help.
splunk cmd 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,