Dashboards & Visualizations

Import contents from an XML file to a dashboard panel

replicamask
Explorer

So I have been looking around and not really finding anything and it's a bit of a long shot.

Currently working on a custom app which is essentially a collection of dashboards for common searches. Each team will have a homepage in the app where the searches (dashboards) will all be listed in a nav type list.
This same list will be populated on the top of each dash for ease of use so people don't have to return to the home page to change what they want to search.

The issue we are facing is trying to keep all these up to date if new dashboards are added over time. Updating each page to have the new nav list is a tedious and prone to error approach and something I would like to avoid.

I've been trying to see if there is a way to have a master nav/links list somewhere where new items can be add. And then in the dashboards and homepages have that reference the file to populate the links list.

We are also looking to keep the dashboards in XML and not convert to HTML if at all possible.

If anyone has any help or advice that would be great! TIA!

Tags (2)
0 Karma
1 Solution

replicamask
Explorer

Thanks for the reply @efavreau! I will definitely be checking this out for future developments as my app moves further!

In the meantime I actually discovered a pretty straightforward solution to my original issue. Utilising the prebuilt panel option.

I was able to add it to my app in the following directory:

/splunk/etc/apps/APP_NAME/local/data/ui/panels/links.xml

Then in my dashboard I was able to call it with the following line (id=links is optional if you are not using CSS):

<panel id="links" ref="links" app="APP_NAME"></panel>

Doing it this way means when I add a new link to the main list all the dashboards will show the change without me having to go and update 20+ different pages just because I added a new dashboard and it needs linking from the others.

I hope this helps someone else out who is looking to achieve the following!

View solution in original post

0 Karma

replicamask
Explorer

Thanks for the reply @efavreau! I will definitely be checking this out for future developments as my app moves further!

In the meantime I actually discovered a pretty straightforward solution to my original issue. Utilising the prebuilt panel option.

I was able to add it to my app in the following directory:

/splunk/etc/apps/APP_NAME/local/data/ui/panels/links.xml

Then in my dashboard I was able to call it with the following line (id=links is optional if you are not using CSS):

<panel id="links" ref="links" app="APP_NAME"></panel>

Doing it this way means when I add a new link to the main list all the dashboards will show the change without me having to go and update 20+ different pages just because I added a new dashboard and it needs linking from the others.

I hope this helps someone else out who is looking to achieve the following!

0 Karma

efavreau
Motivator

Hi @replicamask This answer points you to a comprehensive solution that not only can answer your question, but also a series of follow-up questions.

@dmarling and I ( @efavreau ) presented a way to export, audit, and import your knowledge objects (which includes saved searches, dashboards and more), in a presentation at Splunk .Conf19. Here's a link to the presentation video and slides:
https://conf.splunk.com/watch/conf-online.html?search=FN1315#/

We also put our code up in Github. In the video, a demo is given showing that with little modification, you can use the import query to import in a short period of time. The demo shows me restoring the entire xml of a dashboard back to a known state. So after you watch the video, you can get the code and use it. Here's the github link:
https://github.com/paychex/Splunk.Conf19/

Good Luck!

###

If this reply helps you, an upvote would be appreciated.
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...