InfluxDB Docs

Query data with InfluxQL

InfluxDB Cloud only

Use the InfluxDB 1.x /query compatibility endpoint to query data in InfluxDB 2.0 with InfluxQL. The InfluxDB 1.x compatibility API supports all InfluxDB 1.x client libraries and integrations in InfluxDB 2.0.

Provide the following:

URL-encode the InfluxQL query to ensure it’s formatted correctly when submitted to InfluxDB.

curl -G https://cloud2.influxdata.com/query?db=db&rp=rp \
  -H "Authorization: Token YourAuthToken" \
  --data-urlencode "q=SELECT used_percent FROM mem WHERE host=host1"

By default, the /query compatibility endpoint returns results in JSON. To return results as CSV, include the Accept: application/csv header.

Database and retention policy mapping

InfluxDB 2.0 combines the 1.x concept of databases and retention policies into buckets. To support InfluxDB 1.x query and write patterns in InfluxDB 2.0, databases and retention policies are mapped to buckets using the database and retention policy (DBRP) mapping service. See DBRP mapping for more information.

InfluxQL support

InfluxQL in InfluxDB 2.0 supports read-only queries.

Supported InfluxQL queries
  • SELECT (read-only)
  • SHOW DATABASES
  • SHOW MEASUREMENTS
  • SHOW TAG KEYS
  • SHOW TAG VALUES
  • SHOW FIELD KEYS
Unsupported InfluxQL queries
  • SELECT INTO
  • ALTER
  • CREATE
  • DELETE
  • DROP
  • GRANT
  • KILL
  • REVOKE

Use the InfluxDB 2.0 UI, CLI, and API to perform the following actions:


New! Cloud or OSS?