Getting Data In

Splunk Python Script error - ImportError: No module named azure.keyvault

bhuvanabala
New Member

Hi All,

I am trying to import azure.keyvault through Splunk script input, but i am getting the following error - ImportError: No module named azure.keyvault.

Initially i indexed events via visual studio code editor, where i installed azure.keyvault using command -pip install azure-keyvault.

Now i am trying to run the python code as Splunk script input and getting the error - no module found

I copied the azure SDK for python folders from python(which i installed) sitepackages and placed it under splunk_home/python2.7/Lib/sitepackages/ and restarted Splunk, but still it didnt work

Myscript inculdes below lines

from azure.keyvault import KeyVaultClient, KeyVaultAuthentication
from azure.common.credentials import ServicePrincipalCredentials

Please provide ur inputs

0 Karma

snowmizer
Communicator

It is possible that when you ran the pip install command the azure-keyvault module got installed in the directories pertaining to the Linux system version of Python and not the Splunk version of Python. When I have needed modules that aren't in the Splunk Python I add the module to the bin folder of my app so that it's part of the app. Installing/placing the module in Splunk's Python means that when you upgrade Splunk the module could get removed.

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 ...