Splunk Dev

Import Python Module when creating a new Splunk App

keith_374
New Member

Hello,

I am trying to create a new app which requires a python module not included in Splunk. I read somewhere that you can copy the modules and dependencies to the etc/apps/app/bin. When I do that and try to just import the module I get the following error:

Traceback (most recent call last):
File "/opt/splunk/etc/apps/TA-limac/bin/lc_pythontest_1563939006_862.py", line 14, in
import input_module_lc_pythontest_1563939006_862 as input_module
File "/opt/splunk/etc/apps/TA-limac/bin/input_module_lc_pythontest_1563939006_862.py", line 8, in
import limacharlie
File "/opt/splunk/etc/apps/TA-limac/bin/limacharlie/init.py", line 41, in
from .Manager import Manager
File "/opt/splunk/etc/apps/TA-limac/bin/limacharlie/Manager.py", line 26, in
from .Sensor import Sensor
File "/opt/splunk/etc/apps/TA-limac/bin/limacharlie/Sensor.py", line 5, in
from .utils import *
File "/opt/splunk/etc/apps/TA-limac/bin/limacharlie/utils.py", line 7, in
import gevent.event
File "/opt/splunk/etc/apps/TA-limac/bin/gevent/init.py", line 87, in
from gevent.hub_local import get_hub
File "/opt/splunk/etc/apps/TA-limac/bin/gevent/_hub_local.py", line 101, in
import_c_accel(globals(), 'gevent.
hub_local')
File "/opt/splunk/etc/apps/TA-limac/bin/gevent/_util.py", line 105, in import_c_accel
mod = importlib.import_module(cname)
File "/opt/splunk/lib/python2.7/importlib/
init.py", line 37, in import_module
__import
(name)
ImportError: /opt/splunk/etc/apps/TA-limac/bin/gevent/
_hub_local.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8

Has anyone gotten this before or know a different way to create this app while still using the python module?

Labels (3)
0 Karma

jpolcari22
New Member

Did you find a solution to this? Experiencing the same thing while building out a custom search command and attempting to use gevent/grequests

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...