Dashboards & Visualizations

INIT equivalent in Dashboard Studio?

anapp
Explorer

Can someone confirm if there is a way to set a token in Dashboard Studio "in the background"?

In classic you could set a token in the source using <init>

<init>
    <set token="cost_per_unit">500</set>
</init>

But so far the only way I can see to set this token is via a text input as below but I don't really want it displayed or amendable in the dashboard

    "options": {
        "defaultValue""500",
        "token""cost_per_unit"
    },
    "title""Cost per Unit (USD)",
    "type""input.text"
}

It seems I cannot hide the input, or even place it at the bottom of the dashboard so it isn't too obvious.



This seems basic stuff and I'm getting more than a little frustrated with the lack of functionality in Dashboard Studio but accept this may just be me not finding the correct documentation 🙂

So any pointers would be appreciated

Labels (2)
0 Karma
1 Solution

tscroggins
Influencer

@anapp 

Hi,

You can set token values in the defaults object:

 

{
  ...,
  "defaults": {
    "tokens": {
      "default": {
        "cost_per_unit": {
          "value": "5"
        },
        "units_per_case": {
          "value": "12"
        }
      }
    }
  },
  ...
}

 

This isn't documented in "Set global and local defaults," but following the steps in "Setting tokens on a visualization click" reveals the magic. This behavior may change, so test carefully after each release.

View solution in original post

anapp
Explorer

Fabulous!

Thanks

tscroggins
Influencer

@anapp 

And through the magic of feedback, the documentation has been updated! (Thank you, Splunk tech writer! You're a rock star!) https://docs.splunk.com/Documentation/Splunk/9.0.4/DashStudio/tokens#Default_token

 

0 Karma

tscroggins
Influencer

@anapp 

Hi,

You can set token values in the defaults object:

 

{
  ...,
  "defaults": {
    "tokens": {
      "default": {
        "cost_per_unit": {
          "value": "5"
        },
        "units_per_case": {
          "value": "12"
        }
      }
    }
  },
  ...
}

 

This isn't documented in "Set global and local defaults," but following the steps in "Setting tokens on a visualization click" reveals the magic. This behavior may change, so test carefully after each release.

Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...