Flux syntax

Flux is a functional data scripting language designed for querying, analyzing, and acting on data.

Flux design principles

Flux takes a functional approach to data exploration and processing, but is designed to be usable, readable, flexible, composable, testable, contributable, and shareable.

The following example returns the average CPU usage per minute over the last hour.

  1. from(bucket:"example-bucket")
  2. |> range(start:-1h)
  3. |> filter(fn:(r) =>
  4. r._measurement == "cpu" and
  5. r.cpu == "cpu-total"
  6. )
  7. |> aggregateWindow(every: 1m, fn: mean)

Flux documentation

For more information about Flux syntax, packages, and functions, see:

syntax flux