Installation

howto install and use Splunk python sdk on Windows

coenvandijk
Observer

I'm trying to create a custom search called acltranslate in Splunk on Windows

When running the search I get an error:
Error in 'acltranslate' command: External search command exited unexpectedly with non-zero error code 1.

The log files contains:
08-17-2017 10:18:36.505 INFO ChunkedExternProcessor - Running process: "C:\Program Files\Splunk\bin\python.exe" "C:\Program Files\Splunk\etc\apps\pggm_TA_Windows\bin\acltranslate.py"
08-17-2017 10:18:36.539 ERROR ChunkedExternProcessor - EOF while attempting to read transport header
08-17-2017 10:18:36.540 ERROR ChunkedExternProcessor - Error in 'acltranslate' command: External search command exited unexpectedly with non-zero error code 1.
08-17-2017 10:18:36.540 INFO UserManager - Unwound user context: dijc -> NULL
08-17-2017 10:18:36.543 ERROR ChunkedExternProcessor - stderr: Traceback (most recent call last):
08-17-2017 10:18:36.543 ERROR ChunkedExternProcessor - stderr: File "C:\Program Files\Splunk\etc\apps\pggm_TA_Windows\bin\acltranslate.py", line 2, in
08-17-2017 10:18:36.543 ERROR ChunkedExternProcessor - stderr: from splunklib.searchcommands import dispatch, StreamingCommand, Configuration
08-17-2017 10:18:36.543 ERROR ChunkedExternProcessor - stderr: ImportError: No module named splunklib.searchcommands

Clearly python is unable to find the SDK.

How can I install the python sdk on Windows? All the docmentation I can find seems to be related to Unix/Linux variants. The official documentation provided with the SDK does not mention how to install the sdk on Windows

Tags (1)
0 Karma

rvany
Communicator

You have to add your splunk-lib-directory to the python path. I'm not sure if this doc is still current but it may be worth have a look on:

http://www.linuxtopia.org/online_books/programming_books/python_programming/python_ch28s04.html

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...