Splunk Search

Executing a saved search and on-demand search using REST API

amit_saxena
Communicator

Hi all,

I would like to execute a saved search and also an on-demand hard-coded search using REST API.

While I found a way to execute a hard-coded search, I haven't found a way to execute a saved search using REST API.

Please let me know how to achieve the same.

Regards,
Amit Saxena

Tags (2)
1 Solution

psanford_splunk
Splunk Employee
Splunk Employee

Which language are you using? If you are using a language that we have an SDK for, then I would go that route. Info on SDKs is here: http://dev.splunk.com/view/sdks/SP-CAAADP7

If you want to do it via the REST API - then take a look at these two tutorials:

http://dev.splunk.com/view/SP-CAAADQ5
http://dev.splunk.com/view/saved-searches-and-alerting/SP-CAAADRK

REST API reference docs for saved searches are here: http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTsearch#saved.2Fsearches.2F.7Bname.7D....

You can call dispatch for the search you care about and then you should be off and running.

View solution in original post

psanford_splunk
Splunk Employee
Splunk Employee

Which language are you using? If you are using a language that we have an SDK for, then I would go that route. Info on SDKs is here: http://dev.splunk.com/view/sdks/SP-CAAADP7

If you want to do it via the REST API - then take a look at these two tutorials:

http://dev.splunk.com/view/SP-CAAADQ5
http://dev.splunk.com/view/saved-searches-and-alerting/SP-CAAADRK

REST API reference docs for saved searches are here: http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTsearch#saved.2Fsearches.2F.7Bname.7D....

You can call dispatch for the search you care about and then you should be off and running.

amit_saxena
Communicator

Hi,

Thanks, that worked for me !

Regards,
Amit Saxena

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...