|
We are running a few Python scripts as Splunk scripted inputs. This is an example stanza from our inputs.conf:
The first line of the script specifies which Python to run:
When run from the Linux command line, the script logs this expected version of Python, which is installed as /usr/bin/python:
However, when run as scripted input from Splunk 4.1.2, the script logs this newer version of Python :
Needless to say, the Python version difference breaks something in the script. Question: Why is Splunk running the script with the wrong version of Python? |
|
Splunk't bundled version of python is always used for python scripts. This is like the different between running To use a different python interpreter, simply create small shell script: Example
Or, if you need a more platform independent solution, you can use a small python script to launch a different interpreter.
This was copied from jrodman's post. Since it was so short I figured I'd just copy it here. Update: Just another thought. What happens if you simply rename Thanks, Lowell. We reviewed your excellent response and decided to upgrade our Python script to run with Python 2.6, the version currently used by Splunk. May I recommend that you update the documentation to reveal Splunk's special handling of Python scripts?
(26 May '10, 20:13)
joelshprentz
Did you upgrade your local python install, or are you just using splunk's bundled python distro.... it wasn't clear from your comment... BTW, I don't have access to update the docs. However, you could simply email docs@splunk.com with your request and add a link to this page. The docs team has been very responsive to all my nagging about various little doc issues here and there. ;-)
(26 May '10, 21:01)
Lowell ♦
|
