Splunk Dev

When I am using a Python scripted input is this the path I should use?

daniel333
Builder

All,

First time doing a Python scripted input. For portabability should I be using the local Python on Splunk in my scripted input headers? Or the OS's Python install?

#!/opt/splunk/bin/python

print "hello world"

Or should I point to the specific version as well?

#!/opt/splunk/bin/python2.7

print "hello world"

~                             
0 Karma
1 Solution

xpac
SplunkTrust
SplunkTrust

Splunk will use it's own python version no matter what you put in your headers.

If you for some reason (e.g. using Python 3) want to avoid this, you would have to ship a wrapper shell script that would use a system installed python executable to run the actual Python script - else Splunk will handle it.

View solution in original post

0 Karma

xpac
SplunkTrust
SplunkTrust

Splunk will use it's own python version no matter what you put in your headers.

If you for some reason (e.g. using Python 3) want to avoid this, you would have to ship a wrapper shell script that would use a system installed python executable to run the actual Python script - else Splunk will handle it.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...