Splunk Dev

How can move the knowledge object in Splunk by using Splunk SDK (Python)

tatdat171
Loves-to-Learn Lots

Hi everyone, I am writing the Python script to move the knowledge object to another app.

For example, with the Lookup file:
I can do it with the REST API endpoint 

servicesNS/<user>/<app_name>/data/lookup-table-files/<lookup_file_name/move

 

But I can't find the function to do that with the Splunk Python SDK.

https://docs.splunk.com/DocumentationStatic/PythonSDK/1.7.4/client.html#splunklib.client.Configurati... 
If you have experience with Splunk SDK, please share it with me. Thank!

0 Karma

harsmarvania57
Ultra Champion

Hi @tatdat171 Script which I have created is not out of date. It still works for On-prem and SplunkCloud. I would like to know which functions didn't work for you. Thanks, Harshil 

0 Karma

tatdat171
Loves-to-Learn Lots

Hi @harsmarvania57 ,
I am very appreciate what you did with the script!
In your script, you are using the python package "splunk"

from splunk import mergeHostPath
import splunk.rest as rest
import splunk.auth as auth
import splunk.entity as entity

 
But I can't find the package with pip install. could you give the correct name of package?

0 Karma

harsmarvania57
Ultra Champion

Hi @tatdat171 ,

I am using python modules which are shipped with Splunk Enterprise so to use my script you need Splunk Enterprise as well (you don't need to start/run Splunk Enterprise locally).

0 Karma

tatdat171
Loves-to-Learn Lots

Thank @harsmarvania57, my bad. It worked as well.

I want to write another script that used Splunk SDK, which does not depend on Splunk lib, or must run the script in Splunk server. 
Any way, I nearly finished with my the script by using SDK. 
Thank for your help and your script helped me a lot!

0 Karma

KendallW
Contributor
0 Karma

tatdat171
Loves-to-Learn Lots

Thank @KendallW , that is good reference to CRUD with KOs in the Splunk but the script is out of date, some function did not work anymore.  And he used REST API instead of SDK. 
I am asking about the Splunk SDK.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...