All Apps and Add-ons

Can I create a new dashboard panel with Advanced XML

cmak
Contributor

I have a dashboard that I created using advanced XML which has dropdown menus.
I can use the module : <module name="SearchControls">
in order to get the config buttons. I wrap this module around the interior of my entire dashboard.
When I want to save this dashboard by clicking create->Dashboard Panel (from search controls),
it is a totally irrelevant dashboard that appears.
I do not want to save a simple search, I want to save the entire dashboard with the dropdown options saved.

0 Karma

sideview
SplunkTrust
SplunkTrust

Then you want to do two things.

1) What you want to enable in the SearchControls module is the "Save -> Save Search" menu item, under the "Save" menu. I understand how you're using the terminology, but what the "Create -> Create Dashboard" interaction is doing is correct and as designed. If you don't want the user to be able to create new simple dashboards with simple reports and searches on them, then don't enable that option in the SearchControls module.

2) If you want the saved search to load back in this custom view, and have all of the form elements reload with the original values selected, you will also want to load the "save_create_patches" file, and you can easily do this using the SideviewUtils module.

<module name="SideviewUtils" layoutPanel="appHeader">
  <param name="customJavascript">sideview_utils/save_create_patches.js</param>
</module>

Usually the SideviewUtils module is given no params but as you see above it can take customJavascript params that you can use to include JS from the appserver/static directory of any app on the system.

Without the save_create_patches file loaded, the behavior of saved searches will be just the core Splunk behavior, and notably your UI elements wouldn't reload correctly. Whereas when the file is loaded, all of the viewstate system is disabled, all of the intentions and resurrection system is effectively disabled. Instead of viewstates, the selections of UI elements will be saved directly into savedsearch.conf stanzas where they belong, etc... Lots of little things suddenly happen.

3) Also, this might help you understand the SearchControls module - there is actually a hidden page of documentation just about the SearchControls module, that you can manually go to by going to the app and then manually editing the URL so that it ends in

/app/sideview_utils/search_controls1_intro

0 Karma

sideview
SplunkTrust
SplunkTrust

Do you have a URLLoader at the top of the view? If you don't have a URLLoader then the TextFields and Pulldowns wont restore the old selections. Perhaps post your view XML so I can help you better.

0 Karma

cmak
Contributor

Even after adding the following line, it still does not load correctly.
sideview_utils/save_create_patches.js

In the view tag, should i include the line
displayView="flashtimeline"?

When it is included, my saved search opens up in the default Splunk search UI, not my dashboard.

When it is not included, the saved search opens up in my dashboard, but without my dropdown selections.

Also, do I need to manually add in the save create patches file?

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 ...