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
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...