Documentation

Create a variable

Create dashboard variables in the Data Explorer, from the Settings section, or import a variable. Variable names must be unique.

There are multiple variable types that provide different means of populating your list of variable values. For information about variable types, see Variable types.

Variable name restrictions

Variable names must begin with a letter or underscore (_).

The following names cannot be used as dashboard variables because they are reserved keywords in Flux: and, import, not, return, option, test, empty, in, or, package, and builtin.

Create a variable in the Data Explorer

InfluxData recommends using the Data Explorer to create Query dashboard variables. The Table visualization type and View Raw Data option to provide human-readable query results.

  1. Click the Data Explorer icon in the sidebar.

  2. Use the Query Builder or Script Editor to build a query.

  3. Use the Table visualization type or enable the View Raw Data option to view human-readable query results.

  4. Click Save As in the upper right.

  5. In the window that appears, select Variable.

  6. Enter a name for your variable in the Name field.

  7. Click Create.

For information about common Query variables, see Common variable queries.

Create a variable in the Settings section

  1. Click the Settings icon in the navigation bar.

  2. Select the Variables tab.

  3. Enter a name for your variable.

  4. Select your variable type. For details on each type, see Variable types.

  5. Enter the appropriate variable information.

  6. Click Create.

Import a variable

InfluxDB lets you import variables exported from InfluxDB in JSON format.

  1. Click the Settings icon in the navigation bar.

  2. Select the Variables tab.

  3. Click the Create Variable drop-down menu and select Import Variable.

  4. In the window that appears:

  • Select Upload File to drag and drop or select a file.
  • Select Paste JSON to paste in JSON.
  1. Click Import JSON as Variable.

Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more

InfluxDB v3 enhancements and InfluxDB Clustered is now generally available

New capabilities, including faster query performance and management tooling advance the InfluxDB v3 product line. InfluxDB Clustered is now generally available.

InfluxDB v3 performance and features

The InfluxDB v3 product line has seen significant enhancements in query performance and has made new management tooling available. These enhancements include an operational dashboard to monitor the health of your InfluxDB cluster, single sign-on (SSO) support in InfluxDB Cloud Dedicated, and new management APIs for tokens and databases.

Learn about the new v3 enhancements


InfluxDB Clustered general availability

InfluxDB Clustered is now generally available and gives you the power of InfluxDB v3 in your self-managed stack.

Talk to us about InfluxDB Clustered