Splunk Search

How can I get a result of saved search with loadjob

Masa
Splunk Employee
Splunk Employee

How can I get a result of saved search with loadjob

I'm confused with loadjob.

I have a saved search called "Splunk error last 24 hours". I wanted to see the search result I ran last time from command line.

$ ./splunk search '| loadjob savedsearch="admin:search:Splunk error last 24 hours"' -auth admin:changeme

I thought loadjob can do it. But, the loadjob does not give me search result.
Oh, by the way, this saved search is not scheduled right now. So, I'm testing it manually.
What is wrong?

0 Karma
1 Solution

Masa
Splunk Employee
Splunk Employee

If the saved search is a scheduled saved search, your command should work.

If the saved search is not a scheduled search, and you're looking for the artifact which was run by a user, admin, you need an option job_delegate=admin.


./bin/splunk search '| loadjob savedsearch="admin:search:Splunk errors last 24 hours" job_delegate=admin'

View solution in original post

Masa
Splunk Employee
Splunk Employee

If the saved search is a scheduled saved search, your command should work.

If the saved search is not a scheduled search, and you're looking for the artifact which was run by a user, admin, you need an option job_delegate=admin.


./bin/splunk search '| loadjob savedsearch="admin:search:Splunk errors last 24 hours" job_delegate=admin'

SirHill17
Communicator

Where the result of the loaded job will be display ?

0 Karma

somesoni2
Revered Legend

This is run from Splunk CLI, so it will be shown on the command windows (if run directly) OR in stdout if running from script.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...