Building for the Splunk Platform

Failing import in Splunk Framework app

rantravee
Path Finder

Hi ,

I am trying to write my first Splunk Application Framework app . However I am running into trouble when it comes to the python code associated with my custom module. The problem seems to originate in an import :

"import splunklib.client as client"

Looking into web_service.log I can see the following lines :

2013-09-29 11:10:02,743 ERROR [5247e059c217902b0] root:555 - Unable to start splunkweb
2013-09-29 11:10:02,743 ERROR [5247e059c217902b0] root:556 - No module named splunklib.client

....

ImportError: No module named splunklib.client

Since splunklib is a part of the Python SDK and the Python SDK is available on the Application Framework I thought it would be straightforward to access it . What am I missing here ? How would someone proceed in order to employ the Python SDK in his app ?

Thanks

1 Solution

ineeman
Splunk Employee
Splunk Employee

The way it works in Splunk 6 is that the Python SDK is available to Django code. So if your app Python code is running in Django, you can access the Python SDK (and thus splunklib.client).

I've noted the desire to have it available to all Python code as an enhancement request.

View solution in original post

ineeman
Splunk Employee
Splunk Employee

The way it works in Splunk 6 is that the Python SDK is available to Django code. So if your app Python code is running in Django, you can access the Python SDK (and thus splunklib.client).

I've noted the desire to have it available to all Python code as an enhancement request.

Get Updates on the Splunk Community!

Splunk Cloud | Empowering Splunk Administrators with Admin Config Service (ACS)

Greetings, Splunk Cloud Admins and Splunk enthusiasts! The Admin Configuration Service (ACS) team is excited ...

Tech Talk | One Log to Rule Them All

One log to rule them all: how you can centralize your troubleshooting with Splunk logs We know how important ...

Splunk Security Content for Threat Detection & Response, Q1 Roundup

Join Principal Threat Researcher, Michael Haag, as he walks through: An introduction to the Splunk Threat ...