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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...