Splunk Cloud Platform

splunk cloud - move multiple saved searched from one app to another

sarit_s6
Engager

Hello,

Im using splunk cloud and i have a lot of saved searches - alerts, dashboards, reports that i need to move from one app to another

I have lists that map each saved search to the relevant app

Is there  a way to do it with api or any other way that it is not manually one by one ?

 

Thanks

0 Karma

tscroggins
Influencer

Hi @sarit_s6,

If you haven't already, enable secure access to your instance's REST API by following the guidance at https://docs.splunk.com/Documentation/SplunkCloud/latest/RESTTUT/RESTandCloud.

The full list of supported REST API endpoints is at https://docs.splunk.com/Documentation/SplunkCloud/latest/RESTREF/RESTprolog.

To move a saved search, use the saved/searches/{name}/move endpoint:

$ curl https://{instance}:8089/servicesNS/{user}/{app}/saved/searches/{name}/move -d app={dest_app} -d user={dest_user}

The move endpoint itself isn't documented; however, you can get a list of supported endpoints from the object:

$ curl 'https://{instance}:8089/servicesNS/{user}/{app}/saved/searches/{name}?output_mode=json' | jq '.entry[].links'

{
  "alternate": "/servicesNS/{user}/{app}/saved/searches/{name}",
  "list": "/servicesNS/{user}/{app}/saved/searches/{name}",
  "_reload": "/servicesNS/{user}/{app}/saved/searches/{name}/_reload",
  "edit": "/servicesNS/{user}/{app}/saved/searches/{name}",
  "remove": "/servicesNS/{user}/{app}/saved/searches/{name}",
  "move": "/servicesNS/{user}/{app}/saved/searches/{name}/move",
  "disable": "/servicesNS/{user}/{app}/saved/searches/{name}/disable",
  "dispatch": "/servicesNS/{user}/{app}/saved/searches/{name}/dispatch",
  "embed": "/servicesNS/{user}/{app}/saved/searches/{name}/embed",
  "history": "/servicesNS/{user}/{app}/saved/searches/{name}/history"
}

The form data parameters for the move endpoint are app and user as noted above.

Unofficially, you can find all of the above by moving an object in Splunk Web while observing the /{locale}/splunkd/__raw/servicesNS REST API calls in your browser's dev tools. Those calls can be converted directly to /servicesNS REST API calls on the management port.

Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...