Documentation

Variable types

Variable types determine how a variable’s list of possible values is populated. The following variable types are available:

Map

Map variables use a list of key value pairs in CSV format to map keys to specific values. Keys populate the variable’s value list in the InfluxDB user interface (UI), but values are used when actually processing the query.

The most common use case for map variables is aliasing simple, human-readable keys to complex values.

Map variable CSV example
Juanito MacNeil,"5TKl6l8i4idg15Fxxe4P"
Astrophel Chaudhary,"bDhZbuVj5RV94NcFXZPm"
Ochieng Benes,"YIhg6SoMKRUH8FMlHs3V"
Mila Emile,"o61AhpOGr5aO3cYVArC0"

Query

Query variable values are populated using the _value column of a Flux query.

Query variable example
// List all buckets
buckets()
    |> rename(columns: {"name": "_value"})
    |> keep(columns: ["_value"])

For examples of dashboard variable queries, see Common variable queries.

Important things to note about variable queries

  • The variable will only use values from the _value column. If the data you’re looking for is in a column other than _value, use the rename() or map() functions to change the name of that column to _value.
  • The variable will only use the first table in the output stream. Use the group() function to group everything into a single table.
  • Do not use any predefined dashboard variables in variable queries.

CSV

CSV variables use a CSV-formatted list to populate variable values. A common use case is when the list of potential values is static and cannot be queried from InfluxDB.

CSV variable examples
value1, value2, value3, value4
value1
value2
value3
value4

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

InfluxDB Cloud powered by TSM