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!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...