This is documentation for the next version of Grafana. For the latest stable release, go to the latest version.
Add a custom variable
Use a custom variable for values that do not change. This might be numbers, strings, or even other variables.
For example, if you have server names or region names that never change, then you might want to create them as custom variables rather than query variables. Because they do not change, you might use them in chained variables rather than other query variables. That would reduce the number of queries Grafana must send when chained variables are updated.
Enter General options
- Navigate to the dashboard you want to make a variable for and then click the Dashboard settings (gear) icon at the top of the page.
- On the Variables tab, click New.
- Enter a Name for your variable.
- In the Type list, select Custom.
- (optional) In Label, enter the display name of the variable dropdown. If you don’t enter a display name, then the dropdown label will be the variable name.
- Choose a Hide option:
- No selection (blank) - The variable dropdown displays the variable Name or Label value. This is the default.
- Label - The variable dropdown only displays the selected variable value and a down arrow.
- Variable - No variable dropdown is displayed on the dashboard.
Enter Custom Options
- In the Values separated by comma list, enter the values for this variable in a comma-separated list. You can include numbers, strings, other variables or key/value pairs separated by a space and a colon, i.e.
key1 : value1,key2 : value2.
- (optional) Enter Selection Options.
- In Preview of values, Grafana displays a list of the current variable values. Review them to ensure they match what you expect.
- Click Add to add the variable to the dashboard.
Related Grafana resources
GrafanaCONline 2021 is coming June 7-17
Be the first to learn about exciting next-generation features in Grafana 8.0, be inspired by what community members are building, and attend expert-led sessions and workshops on Grafana, Prometheus, Loki logs, and more.
Unify your data with Grafana plugins: Splunk, MongoDB, Datadog, and more
Show how Grafana can be used to take data from multiple different sources and unify it, without disrupting the investments that are working today.
Demo: Getting started with Grafana Enterprise and observability
Join the Grafana Labs team for a 30-minute demo of how to get started with the Grafana Stack, so you can go from zero to observability in just a few minutes.