Reporting

How to retrieve Saved search name from job sid?

SIddharth5794
Explorer

While using Splunk SDK of Python, how do you get the details of the saved search that initiated the job.
I have the job sid of the jobs going on and some jobs which are done processing. I want their Saved Search name or their Saved Search ID.

0 Karma
1 Solution

SIddharth5794
Explorer

Found the answer.
if,
import splunklib.client as client

services=client.connect(...)
jobs=service.jobs

for job in jobs:
    job.content['label']   #Will give you the saved_search name

View solution in original post

0 Karma

SIddharth5794
Explorer

Found the answer.
if,
import splunklib.client as client

services=client.connect(...)
jobs=service.jobs

for job in jobs:
    job.content['label']   #Will give you the saved_search name
0 Karma
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...