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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...