Documentation

Flux Query package

Flux 0.60.0+

The query package is experimental and subject to change at any time. By using this package, you accept the risks of experimental functions.

Flux Query functions provide functions meant to simplify common InfluxDB queries. Import the experimental/query package:

import "experimental/query"

Functions

inBucket()

The primary function in this package is query.inBucket(), which uses all other functions in this package.

import "experimental/query"

query.inBucket(
  bucket: "example-bucket",
  start: -1h,
  stop: now(),
  measurement: "example-measurement",
  fields: ["exampleField1", "exampleField2"],
  predicate: (r) => r.tagA == "foo" and r.tagB != "bar"
)

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.