Dashboard variables are useful when you would like to modify dashboard cells without editing the original queries based on which the dashboard is built. You can also use Flux to build queries for dashboard cells.
Dashboard variables can be
- Custom: defined in the user interface
Variables are stored in a
v standing for a particular dashboard
from(bucket: v.bucket) |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == v._measurement and r.field == v.field) |> aggregateWindow(every: v.windowPeriod, fn: mean)
- Check available variables on the right hand side under the Variables tab
- Select the name of the variable you would like to add
- Select a value from the Value dropdown
After adding the variable, the dashboard's url will have the following structure appended to its end
&vars[variable_name]=value. This allows you to directly share the dashboard with the variable included with a simple url.
You can create variables for your dashboard in the following ways:
- in the Data Explorer
- in Settings
- via import
Variable names has to
- be unique
- start with and underscore '
- they cannot be one of the Flux reserved keywords: and, import, not, return, option, test, empty, in, or, package, and builtin.