Dashboards & Visualizations

changing a parameter in multiple charts for a dashboard

habisht
Explorer

Hi All, I'm trying to create a dashboard with multiple charts in a dashboard. And want to change a single parameter i.e. environment in all the charts with a common drop-down. Is there any way to do this?

Tags (1)
0 Karma

niketn
Legend

@habisht this should be straight-forward depending on the field which corresponds to environment using token through Dropdown. For example if environment is linked to index or sourcetype in your data (or both), then you can create a dropdown following the guideline from Splunk Documentation (https://docs.splunk.com/Documentation/Splunk/latest/Viz/FormEditor#Dropdown_input) or Splunk Dashboard Examples App from Splunkbase.

While the Label in the dropdown will show the Label as selected environment, its Value will be the part of SPL (Splunk Query) that needs to change.

Following is an example of dropdown with token $tokEnvironment$ which sets the corresponding environment filter in the SPL (I have taken index to be different for different environment but same sourcetype).

<input type="dropdown" token="tokEnvironment">
   <label>Select Environment</label>
   <default>index=yourDevIndex sourcetype=yourSourceType</default>
   <choice value="index=yourDevIndex sourcetype=yourSourceType">Development</choice>
   <choice value="index=yourStageIndex sourcetype=yourSourceType">Staging</choice>
   <choice value="index=yourProdIndex sourcetype=yourSourceType">Production</choice>
</input>

Then use $tokEnvironment$ in your SPL query

<search>
    <query> $tokEnvironment$ <yourRemainingQueryGoesHere>
    </query>
</search>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...