Splunk Search

Does the REST API allow to retrieve the XML source code of Classic Dashboards?

danielbb
Motivator

I sometimes lose the source code of a dashboard, and therefore, I wonder if I can automatically take a backup of my dashboards within time intervals by using the REST API, is this possible? Or is there by any chance already an existing app for this?

Labels (1)
Tags (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

We have saved searches that run in certain sites that collect knowledge objects, dashboards, macros and so on, using the rest API as shown by @livehybrid. It writes the data to a summary index if the data has changed. Runs reasonably frequently, so there's always a recent backup to go back to if necessary.

 

livehybrid
SplunkTrust
SplunkTrust

Hi @danielbb 

Have a look at this:

| rest /servicesNS/-/-/data/ui/views | search eai:acl.app="<yourAppName>" version!="2" | table title eai:data

livehybrid_0-1763586931083.png

 

The 'eai:data' field contains the source code of the dashboard. The version field is 2 for Dashboard Studio or 1/1.1 for Classic dashboards.

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...