Getting Data In

How to export/import saved searches REST API

mforgues
Engager

Hi,

I'm trying to found a way to export through the REST API my saved searches.

Running the following command seems to generate the correct export :

curl -k -u admin:changeme https : //localhost:8089/servicesNS/ocs/-/saved/searches > saved_searches

Now for the tricky part, I'm trying to adjust the file to import it back to another server.

Could you help me determine if this is possible?

Thanks,

Mathieu

Labels (1)
0 Karma

tro
Path Finder

Is there any new way how to do it with recent Splunk version?

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You could use http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTapps#apps.2Flocal.2F.7Bname.7D.2Fpack... to package the app and install it on another server as any other app. Between those steps you can change savedsearches.conf in the archive as you need.

mforgues
Engager

curl -k -u admin:pass https://[Splunk Host]:[Management Port]/services/apps/local/{name}/package

+

https://[Splunk Host]:[Management Port]/static/app-packages/{name}.spl

Did the job 🙂

Thanks,

Mathieu

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...