Splunk Dev

Specifying a TTL when creating a job via the API?

dart
Splunk Employee
Splunk Employee

Is it possible to create a search job with Splunk's Python SDK and specify the TTL?
In the same way as when using a saved search you can specify dispatch.ttl

1 Solution

araitz
Splunk Employee
Splunk Employee

It appears that you are looking for setttl method on the Job object:

https://github.com/splunk/splunk-sdk-python/blob/master/splunk/client.py

def setttl(self, value):
    self.post("control", action="setttl", ttl=value)

View solution in original post

araitz
Splunk Employee
Splunk Employee

It appears that you are looking for setttl method on the Job object:

https://github.com/splunk/splunk-sdk-python/blob/master/splunk/client.py

def setttl(self, value):
    self.post("control", action="setttl", ttl=value)

dart
Splunk Employee
Splunk Employee

This is possible:

import splunk.client as client
service = client.connect(**{'username':'admin','password':'changeme'})
service.parse('search index=*', parse_only=True)
job = service.jobs.create('search index=*',**{'timeout':'123456'})
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...