Dashboards & Visualizations

Dashboard Studio | How do I encode inputs into the URL of a dashboard?

jprior
Explorer

When the page gets reloaded for my Dashboard Studio dashboard all of the inputs get reset. I have to enter all the inputs again which is disruptive to my workflow.

This is particularlly annoying in two use cases:

1. When I reboot my machine chrome remembers my tabs but it causes the page to reload. So after a reboot I have to enter all the inputs again.

2. When the SSO times out at my company it causes a login page to load, then after auth it navigates back to the dashboard. This is annoying because it can happen any time of the day.

Is there a solution for this? Can I encode the input values into the URL for the dashboard so it will automatically load with the correct values even if the page is reloaded?

 

Here is the source for my inputs

{
    "type": "input.timerange",
    "options": {
        "token": "global_time",
        "defaultValue": "-24h@h,now"
    },
    "title": "Time Range"
}

{
    "options": {
        "items": [
            {
                "label": "All",
                "value": "US, CA, GB"
            },
            {
                "label": "US",
                "value": "US"
            },
            {
                "label": "CA",
                "value": "CA"
            },
            {
                "label": "GB",
                "value": "GB"
            }
        ],
        "defaultValue": "US, CA, GB",
        "token": "selectedRegion"
    },
    "title": "Region",
    "type": "input.dropdown"
}

{
    "options": {
        "items": [
            {
                "label": "Unique Companies",
                "value": "realms"
            },
            {
                "label": "Percentage of Total Traffic",
                "value": "percentage"
            }
        ],
        "defaultValue": "realms",
        "token": "selectedMode"
    },
    "title": "Mode",
    "type": "input.dropdown"
}

 

Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You can define initial values as well as default values (at least you can in Classic dashboards) - the other way is to pass them as parameter on the URL e.g. &form.input1=abc

0 Karma

jprior
Explorer

What would be the specific encoding to pass the options on the URL for my case? Let's say I want to set the Region selector to "GB"?

For that select here is the critical information:

  • Title: Region
  • Token Name: selectedRegion
  • Input ID: input_npJ29MjX

None of these random guesses worked for me:

  • ?form.Region=GB
  • ?form.selectedRegion=GB
  • ?form.input_npJ29MjX=GB
  • ?form.input_npJ29MjX.value=GB
  • ?form.input_npJ29MjX.selected=GB
  • ?Region=GB
  • ?selectedRegion=GB
  • ?input_npJ29MjX=GB
  • ?input_npJ29MjX.value=GB
  • ?input_npJ29MjX.selected=GB
  • ?form.Region="GB"
  • ?form.selectedRegion="GB"
  • ?form.input_npJ29MjX="GB"
  • ?form.input_npJ29MjX.value="GB"
  • ?form.input_npJ29MjX.selected="GB"
  • ?Region="GB"
  • ?selectedRegion="GB"
  • ?input_npJ29MjX="GB"
  • ?input_npJ29MjX.value="GB"
  • ?input_npJ29MjX.selected="GB"
  • ?form.Region=3
  • ?form.selectedRegion=3
  • ?form.input_npJ29MjX=3
  • ?form.input_npJ29MjX.value=3
  • ?form.input_npJ29MjX.selected=3
  • ?Region=3
  • ?selectedRegion=3
  • ?input_npJ29MjX=3
  • ?input_npJ29MjX.value=3
  • ?input_npJ29MjX.selected=3
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

This works for me

?form.selectedRegion=GB

Which version of Splunk are you using?

0 Karma

jprior
Explorer

Does that work for you on a Dashboard Studio dashboard?

We have version 8.2.7.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Yes, Dashboard Studio but I am on 9.1.0.1

0 Karma
Get Updates on the Splunk Community!

Meet Duke Cyberwalker | A hero’s journey with Splunk

We like to say, the lightsaber is to Luke as Splunk is to Duke. Curious yet? Then read Eric Fusilero’s latest ...

The Future of Splunk Search is Here - See What’s New!

We’re excited to introduce two powerful new search features, now generally available for Splunk Cloud Platform ...

Splunk is Nurturing Tomorrow’s Cybersecurity Leaders Today

Meet Carol Wright. She leads the Splunk Academic Alliance program at Splunk. The Splunk Academic Alliance ...