Documentation

Explore your schema with InfluxQL

Use InfluxQL SHOW statements to return information about your data schema.

Sample data

The following examples use data provided in sample data sets. To run the example queries and return identical results, follow the instructions provided for each sample data set to write the data to your InfluxDB Cloud Dedicated database.

List measurements in a database

Use SHOW MEASUREMENTS to list measurements in your InfluxDB database.

SHOW MEASUREMENTS

View example output

List measurements that contain specific tag key-value pairs

To return only measurements with specific tag key-value pairs, include a WHERE clause with tag key-value pairs to query for.

SHOW MEASUREMENTS WHERE room = 'Kitchen'

View example output

List measurements that match a regular expression

To return only measurements with names that match a regular expression, include a WITH clause that compares the MEASUREMENT to a regular expression.

SHOW MEASUREMENTS WITH MEASUREMENT =~ /^home/

View example output

List field keys in a measurement

Use SHOW FIELD KEYS to return all field keys in a measurement. Include a FROM clause to specify the measurement. If no measurement is specified, the query returns all field keys in the database.

SHOW FIELD KEYS FROM home

View example output

List tag keys in a measurement

Use SHOW TAG KEYS to return all tag keys in a measurement. Include a FROM clause to specify the measurement. If no measurement is specified, the query returns all tag keys in the database.

SHOW TAG KEYS FROM home_actions

View example output

List tag keys in measurements that contain a specific tag key-value pair

To return all tag keys measurements that contain specific tag key-value pairs, include a WHERE clause with the tag key-value pairs to query for.

SHOW TAG KEYS WHERE room = 'Kitchen'

View example output

List tag values for a specific tag key

Use SHOW TAG VALUES to return all values for specific tags in a measurement.

  • Include a FROM clause to specify the measurement. If no measurement is specified, the query returns all tag values from the specified tag keys in the database.
  • Use the WITH clause to compare KEY to tag keys to list the values of.
  • Use the WHERE clause to restrict the search to a specific time range (default time range is the current time minus 1 day).

Tag and field values aren’t indexed in InfluxDB Cloud Dedicated - SHOW TAG VALUES scans all tag values within the given time range. Because SHOW TAG VALUES can be an intensive operation, it has a default time range equal to the current time minus 1 day. To query more or less data, specify a time range in the WHERE clause.

SHOW TAG VALUES FROM weather WITH KEY = location

View example output

List tag values for multiple tags

To return tag values for multiple specific tag keys, use the IN operator in the WITH clause to compare KEY to a list of tag keys.

SHOW TAG VALUES FROM home_actions WITH KEY IN ("level", "action")

View example output

List tag values for tags that match a regular expression

To return only tag values from tags keys that match a regular expression, use regular expression comparison operators in your WITH clause to compare KEY to the regular expression.

SHOW TAG VALUES WITH KEY =~ /oo/

View example output

List tag values associated with a specific tag key-value pair

To list tag values for tags associated with a specific tag key-value pair:

  • Use the WITH clause to identify what tag keys to return values for.
  • Include a WHERE clause that identifies the tag key-value pair to query for.

The following example returns tag values for the action and level tags for points where the room tag value is Kitchen.

SHOW TAG VALUES WITH KEY IN ("action", "level") WHERE room = 'Kitchen'

View example output


Was this page helpful?

Thank you for your feedback!


Introducing InfluxDB Clustered

A highly available InfluxDB 3.0 cluster on your own infrastructure.

InfluxDB Clustered is a highly available InfluxDB 3.0 cluster built for high write and query workloads on your own infrastructure.

InfluxDB Clustered is currently in limited availability and is only available to a limited group of InfluxData customers. If interested in being part of the limited access group, please contact the InfluxData Sales team.

Learn more
Contact InfluxData Sales

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.

Flux is going into maintenance mode and will not be supported in InfluxDB 3.0. This was a decision based on the broad demand for SQL and the continued growth and adoption of InfluxQL. We are continuing to support Flux for users in 1.x and 2.x so you can continue using it with no changes to your code. If you are interested in transitioning to InfluxDB 3.0 and want to future-proof your code, we suggest using InfluxQL.

For information about the future of Flux, see the following:

State of the InfluxDB Cloud Serverless documentation

InfluxDB Cloud Serverless documentation is a work in progress.

The new documentation for InfluxDB Cloud Serverless is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.