Splunk Dev

Splunk Enterprise Python SDK doesn't recognize custom search command

kmstepien
New Member

I have a test environment on my laptop. I get the following error:

Unknown search command 'mycommand'.

Details are:
- Using Splunk Enterprise 8.0.1 on macOS running Mojave
- Created a new app called python_sdk_app and revised permissions to “All apps”
- Installed Splunk SDK 1.6.11 in bin folder of the app using ‘pip install -t . splunk-sdk’
- Created commands.conf inside the default directory of the app (also tried the local directory)
- Restarted splunk

commands.conf file:
[mycommand]
chunked=true
filename=mycommand.py

package locations:
$ python -m site
sys.path = [
'/Applications/Splunk/splunk-sdk-python-1.6.11',
'/anaconda3/lib/python36.zip',
'/anaconda3/lib/python3.6',
'/anaconda3/lib/python3.6/lib-dynload',
'/anaconda3/lib/python3.6/site-packages',
'/anaconda3/lib/python3.6/site-packages/aeosa',
'/anaconda3/lib/python3.6/site-packages/splunk_sdk-1.6.11-py3.6.egg',
]

environment variables:
SHELL=/bin/bash
SPLUNK_HOME=/Applications/Splunk
PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin:/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PYTHONPATH=/Applications/Splunk/splunk-sdk-python-1.6.11

Labels (2)
0 Karma

kmstepien
New Member

My commands.conf file was not in the correct format (i.e. hidden characters). Once that issue was resolved, the mycommand.py file could not be found so I removed the filename=mycommand.py from the commands.conf file and everything worked. This was my first question to the forum - unsure how to close it. I see no option for rescinding the question.

0 Karma
Get Updates on the Splunk Community!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...