Alerting

Is there a way to export all searches, alerts and reports from all users to another Splunk instance?

DanielUhlmann
New Member

Hello guys,

My question is pretty simple. Is there a easy way to export all your searches/reports and alerts created from every user, from one splunk indexer instance to another instance? My only suggestion for this problem was to locate all savedsearches.conf from every user and create the users on my new machine and copy all the conf. files. So my question is if there's an easier way to do this.

regards,

Daniel

0 Karma

gjanders
SplunkTrust
SplunkTrust

I wrote transfersplunkknowledgeobjects.py for this purpose about 9 months ago, this forms the basis for one of my apps Version Control for Splunk

There is also a github repository and an excellent conf presentation linked here:
FN1315 - Cover Your Assets: Protect Your Knowledge Objects from Yourself (and Others) - A Paychex st...

gerrysr6
Explorer

I'm trying to export and import alerts from one search head to a new search head. 

Can  transfersplunkknowledgeobjects.py be used for this?

I don't know what to use for "-srcApp" so I am trying "alerts" (without the quotes)

Right now I'm getting 404 errors. I do have a Bearer Token but where to put it?

I looked at "Version Control for Splunk" but that is even harder to figure out how to use it.

0 Karma

DanielUhlmann
New Member

@felipesewaybricker

Do you copy this out from your Webview or from your Splunk Indexer Server?

Regards

0 Karma

felipesewaybric
Contributor

From my search head.

What I recommend is to create a new app folder, copy the folder structure from /opt/splunk/apps/, then all you need is to keep the files with the searchs and reports (savedsearch.conf), dashboards (data/ui/views folder), and others that you want to move.

0 Karma

DanielUhlmann
New Member

@felipesewaybricker

Thanks for your suggestion! I've ported every application from /apps now to my new splunk Head but now the App "launcher" is missing. Isn't this just the normal Splunk package which comes by default when you install splunk, because this is the 'core'?

Thanks in advance.

0 Karma

DanielUhlmann
New Member

@felipesewaybricker

So I copied the complete apps/ folder now. Now I can use them in my new Head if I replace the existing apps folder with my old one, right?

0 Karma

felipesewaybric
Contributor

Almost, you dont need to copy all the app folder, only thoses apps that have info. The default app is called search.

0 Karma

kariras06
Explorer
0 Karma

tkopchak
SplunkTrust
SplunkTrust

Something to keep in mind when doing this sort of migration - just copying the user data will likely not be sufficient for everything to work properly. You will also need to ensure that any knowledge objects used by existing reports (field extractions, lookups, etc) are migrated as well.

If this is a case where you are replacing your search head with a new one, it would make the most sense to perform a migration of the configuration to ensure everything is moved over.

0 Karma

Noah_Woodcock
Path Finder

AppExporter

That is a tool that I use for situations like this.

0 Karma

gerrysr6
Explorer

App Exporter looks promising... how to use it to export Alerts and Reports as requested by Daniel?

0 Karma

woodcock
Esteemed Legend

Check out this REST API endpoint:

/servicesNS/-/-/
0 Karma

MonkeyK
Builder

This post looks helpful:
https://answers.splunk.com/answers/49477/query-to-retrieve-saved-search-string.html
https://answers.splunk.com/answers/107423/using-splunk-rest-to-list-saved-searches-only-returns-a-li...

and creating searches using REST API
http://docs.splunk.com/Documentation/Splunk/latest/RESTTUT/RESTsearches

Unfortunatly, that is as much as I can show because I do not have access to the REST API in my environment.

0 Karma

felipesewaybric
Contributor

Is easy, just copy those xml from views and the savedsearch file to another app, or create a new one and copy.

saibal6
Path Finder

Thanks @felipesewaybricker .

I have tried it and it is working perfectly. But need to create a documentation on this, so I need the Splunk suggested documents. Could you please add any splunk documents link?

Thanks,
@saibal6

0 Karma

mstjohn_splunk
Splunk Employee
Splunk Employee

@danieluhlmann

Were you able to solve your problem? If so, please describe how you were able to do this in an answer post.

If your problem is still not solved, keep us updated so that someone else can help ya.

Thanks for posting!

0 Karma

mstjohn_splunk
Splunk Employee
Splunk Employee

Hi @DanielUhimann,

Not sure if this helps you, but I stumbled upon this in Splunk Docs: https://docs.splunk.com/Documentation/Splunk/7.1.2/Installation/MigrateaSplunkinstance

Does anything in there help?

adonio
Ultra Champion

copy the entire users directory?
what is it exactly that you are trying to do? and why?

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...