All Apps and Add-ons

I had to modify splunklib/binding.py to make Splunk_SA_Scientific_Python_darwin_x86_64 import ssl in Anaconda work

JLeeatCBA
Explorer

After calling

Just to get the simplest use out of numpy, I had to change in splunklib/binding.py

import ssl

to

from OpenSSL import SSL

...SSL in capitals.
Now I don't know if there will be a run-time error when/if ssl is used.

I don't think this is the correct fix.

Mac OS
Fresh install of Splunk Enterprise dev.
Install of Splunk_SA_Scientific_Python_darwin_x86_64

0 Karma

JLeeatCBA
Explorer

Here is the traceback showing that it can't import ssl
(But from CLI - using python from the command line, import ssl works ok)
08-31-2018 10:12:08.014 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py GETINFO': Traceback (most recent call last):
08-31-2018 10:12:08.014 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py GETINFO': File "/Applications/Splunk/etc/apps/mlapp/bin/ml.py", line 12, in
08-31-2018 10:12:08.015 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py GETINFO': from splunklib.searchcommands import \
08-31-2018 10:12:08.015 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py GETINFO': File "/Applications/Splunk/etc/apps/mlapp/bin/splunklib/searchcommands/init.py", line 148, in
08-31-2018 10:12:08.015 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py GETINFO': from .generating_command import GeneratingCommand
08-31-2018 10:12:08.016 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py GETINFO': File "/Applications/Splunk/etc/apps/mlapp/bin/splunklib/searchcommands/generating_command.py", line 17, in
08-31-2018 10:12:08.016 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py GETINFO': from . search_command import SearchCommand
08-31-2018 10:12:08.016 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py GETINFO': File "/Applications/Splunk/etc/apps/mlapp/bin/splunklib/searchcommands/search_command.py", line 19, in
08-31-2018 10:12:08.017 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py GETINFO': from splunklib.client import Service
08-31-2018 10:12:08.017 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py GETINFO': File "/Applications/Splunk/etc/apps/mlapp/bin/splunklib/client.py", line 70, in
08-31-2018 10:12:08.017 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py GETINFO': from binding import Context, HTTPError, AuthenticationError, namespace, UrlEncoded, encode
08-31-2018 10:12:08.017 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py __GETINFO
': File "/Applications/Splunk/etc/apps/mlapp/bin/splunklib/binding.py", line 30, in
08-31-2018 10:12:08.018 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py __GETINFO
': import ssl
08-31-2018 10:12:08.018 ERROR ScriptRunner - stderr from '/Applications/Splunk/bin/python /Applications/Splunk/etc/apps/mlapp/bin/ml.py __GETINFO
_': ImportError: No module named ssl

0 Karma

JLeeatCBA
Explorer

maybe

from OpenSSL import SSL as ssl

Don't know. It's uncomfortable to have to do this to get a clean install to run at all.

0 Karma

JLeeatCBA
Explorer

Hmm. It looks like the syntax for OpenSSL and ssl are different.
So this is not a solution.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...