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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

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

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...