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

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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...