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!

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 ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...