Dashboards & Visualizations

Sending variables to a dashboard

Path Finder

Is there any way to set a dashboard variable value via the url? It'd be nice to be able to do something like:

https://splunk4/en-US/app/myApp/myDashBoard?client=foo

And have the value of client available in the dashboard code as $client$.

Is there some way to accomplish this now?

Tags (1)

Path Finder

From Nick: "It's one of the significant things being worked on for the next big release"

So is this in 4.2 ??

0 Karma

Path Finder

Releases are typically classified as major, minor and change. There are others, but I am guessing that Nick meant major version, which would be 5.0.

0 Karma

SplunkTrust
SplunkTrust

No Im afraid that we dont have anything like this in 4.1 nor in 4.0.

It's one of the significant things being worked on for the next big release.

If you are all of the following:

a) very familiar with Javascript in general
b) very familiar with Jquery in particular,
c) already in the advanced XML
d) willing to roll up your sleeves even further,

then you can sometimes workaround this limitation by putting a custom application.js file into your app and writing your own Javascript there.

Here's an example where I had a ServerSideInclude module on the page that would serve as a dynamic page title, and I write the value of a 'pageTitle' argument from the URL into that ServerSideInclude element.

$(function() {
    var qsDict = Splunk.util.queryStringToProp(document.location.search);
    if ("pageTitle" in qsDict) {
        $(".DM_pageTitle h1").text(qsDict["pageTitle"])
    }  
})

With some work you could use the same trick to do other things like set the selected state of a pulldown in a SearchSelectLister module.

Super Champion

Pretty sure you couldn't do this in 4.0. I'm not sure about 4.1. I think this would be a great feature. +1

0 Karma