Splunk Dev

Is it necessary to put `shebang` on custom scripts?

morethanyell
Builder

Is it necessary to put `shebang` on custom Python script that will be executed by `splunk`? The reason why I ask is because `shebang` is `#!/usr/local/bin/python` but we know that Spunk uses the one $SPLUNK_HOME/bin/python3.

 

Thanks in advance.

Labels (3)
0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

The correct form of shebang for python3 is

#!/usr/bin/env python3

But that's not the main point here.

Splunk should spawn its own python instance for python script regardless of the shebang (and shebang allows for easy testing outside of splunk environment)

View solution in original post

0 Karma

PickleRick
SplunkTrust
SplunkTrust

The correct form of shebang for python3 is

#!/usr/bin/env python3

But that's not the main point here.

Splunk should spawn its own python instance for python script regardless of the shebang (and shebang allows for easy testing outside of splunk environment)

0 Karma
Get Updates on the Splunk Community!

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...