Dashboards & Visualizations

How to set values in one location for use in multiple dashboards?

simpkins1958
Contributor

We are developing a Splunk application for Splunkbase that has dozen's of dashboards. Would like to be able to set common values for chart options is one location to be used by multiple dashboards. Have tried to use tokens, macros, and Javascript with no success.

For example, below is XML for the Clustered Single Value Map. Would like to be able to set mapCenterLat, mapCenterLon, and mapCenterZoom in one location in our Splunk application and each of 10+ instances of the map in multiple dashboard use those values.

      <viz type="leaflet_maps_app.leaflet_maps" id="clusterMapId">
        <title>NEW</title>
        <search>
          <query><![CDATA[source=netmotion sourcetype=wifi_connect secure=0 d_name="$deviceNameToken$" ssid="$ssidToken$" lat="*" lon="*"
               | fillnull user value="unknown"
               | eval icon=case(plat="iOS", "fa-apple", plat="PC", "fa-windows", plat="Android", "fa-android")
               | eval description="<table><tr><td>Device:</td><td>".d_name."</td></tr><tr><td>User:</td><td>".user."</td></tr><tr><td>Platform:<td>".plat."</td></tr><tr><td>SSID:<td>".ssid."</td></tr><tr><td>Time:</td><td>".strftime(_time, "%c")."</td></tr></table>"
               | eval latitude=lat
               | eval longitude=lon
               | eval title="This is not working when mouse is hovered over marker..."
               | table latitude longitude description title icon markerColor]]>
          </query>        
        </search>
        <option name="leaflet_maps_app.leaflet_maps.mapCenterLat">46.0</option>
        <option name="leaflet_maps_app.leaflet_maps.mapCenterLon">120.0</option>
        <option name="leaflet_maps_app.leaflet_maps.mapCenterZoom">6</option> 
0 Karma

sundareshr
Legend

You could store all the values in a kvstore. In your dashboard, at the top, assign the values from kvstore to tokens. Something like this may work

<dashboard>
<init>
<search><query>| inputlookup kvstorewithvaluesinonerow</query> <---- should return only one row with fields for each value
<done>
<set token="mapCenter">$result.field1$</set>
<set token="mapRight">$result.field2$</set>
</done>
</search>
</init>
.....
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 ...