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
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
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.
Hmm. It looks like the syntax for OpenSSL and ssl are different.
So this is not a solution.