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!

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 ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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