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
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...