Documentation

Flux reference documentation

All Flux reference material is provided in the Flux documentation:

View the Flux documentation

Flux with the InfluxDB IOx storage engine

When querying data from an InfluxDB bucket backed by InfluxDB IOx, use the following input functions:

Both IOx-based input functions return pivoted data with a column for each field in the output. To unpivot the data:

  1. Group by tag columns.
  2. Rename the time column to _time.
  3. Use experimental.unpivot() to unpivot the data. All columns not in the group key (other than _time) are treated as fields.
import "experimental"
import "experimental/iox"

iox.from(bucket: "example-bucket", measurement: "example-measurement")
    |> range(start: -1d)
    |> group(columns: ["tag1", "tag2". "tag3"])
    |> rename(columns: {time: "_time_"})
    |> experimental.unpivot()
import "experimental"
import "experimental/iox"

query = "SELECT * FROM \"example-measurement\" WHERE time >= now() - INTERVAL '1 day'"

iox.sql(bucket: "example-bucket", query: query)
    |> group(columns: ["tag1", "tag2". "tag3"])
    |> rename(columns: {time: "_time_"})
    |> experimental.unpivot()

Flux performance with InfluxDB IOx

When querying data from an InfluxDB bucket backed by InfluxDB IOx, using iox.from() is less performant than querying a TSM-backed bucket with from(). For better Flux query performance, use iox.sql().


Was this page helpful?

Thank you for your feedback!


Linux Package Signing Key Rotation

All signed InfluxData Linux packages have been resigned with an updated key. If using Linux, you may need to update your package configuration to continue to download and verify InfluxData software packages.

For more information, see the Linux Package Signing Key Rotation blog post.

State of the InfluxDB Cloud (IOx) documentation

The new documentation for InfluxDB Cloud backed by InfluxDB IOx 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.

InfluxDB Cloud powered by IOx