Splunk Dev

splunk remote server SDK access (Python)

sunilsattiraju
Engager

I am trying to access remote splunk instance and on the local machine i have splunk SDK downloaded and installed splunk-sdk and added export PYTHONPATH=~/splunk-sdk-python to my .bash_profile.
when i try to execute the examples e.g. python info.py i get the below error

__ File "info.py", line 23, in
__ from utils import parse
__ ImportError: cannot import name parse

i have utils 0.1 installed. Any idea on how to run the splunk sdk examples.

BTW i am running python2.6 on CentOS
Thanks

Tags (1)

psanford_splunk
Splunk Employee
Splunk Employee

This is a question related to the Python SDK - http://dev.splunk.com/view/python-sdk/SP-CAAAEBB - which works with Python 2.6+.

Utils comes with the SDK - so there is no extra installation required. Have you done all of the setup required outlined on the link above?

We have a number of command line examples here as well to try: http://dev.splunk.com/view/SP-CAAAEFK#info

Brian_Osburn
Builder

Splunk uses Python 2.7 last time I checked.

Easy way to check if it's your Python version that's having the issue is to run the script like this:

$SPLUNK_HOME/bin/splunk cmd python

Brian

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...