splunk-sdk-python icon indicating copy to clipboard operation
splunk-sdk-python copied to clipboard

There should be a way to get sids or job objects from subsearches spawned by append via a specific job object or sid

Open tjh2822 opened this issue 8 years ago • 1 comments

When creating jobs through client there is no way to get the information about any jobs that are spawned by commands like append. This information is important as these jobs might need to be deleted and the information they give back is certainly helpful.

splunklib.client is excellent for running many of the same search with different time. As a user I would like to delete my searches (and the sub searches they create) to not take up too much disk space and exceed my limit.

import splunklib.client as client service=client.connect(...) ... search="| search index=bla | append [ | makeresults bla] " (two searches are created here) ... jobs=service.jobs job=jobs.create("search", **kwargs) ... jobs.delete(job["sid"]) (only one is deleted as the appended search has a different sid)

Which is a problem if I am making hundreds of these with a while loop.

The sid of the appended searches does have the sid of the parent in it as well as their own unique identifiers. They should be easy to find and return.

tjh2822 avatar Nov 07 '18 21:11 tjh2822

Hi @tjh2822 - I think I understand the problem, but I'd like to hear a little more about:

  • your use case
  • the solution you're looking for (are you looking for the deletion of a parent search to automatically delete all child searches?)

tdhellmann avatar Nov 09 '18 18:11 tdhellmann