Splunk Dev

Set namespace for a search with PythonSDK

aarcro
Explorer

It is possible to set the namespace for a search job with the pythonSDK? Something like:

service = client.connect()
job = service.jobs.create('search * | head 5', namespace='SplunkForNagios')

I know I can set the app in the connect() call, but I was hoping to keep a global connection open, and just set the app when I execute a search.

Tags (1)
0 Karma
1 Solution

aarcro
Explorer

this works:

job = service.jobs.create('search * | head 5', app='SplunkForNagios')

So the PythonSDK must map the keyword app to the REST API parameter namespace.

View solution in original post

0 Karma

aarcro
Explorer

this works:

job = service.jobs.create('search * | head 5', app='SplunkForNagios')

So the PythonSDK must map the keyword app to the REST API parameter namespace.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...