Documentation

Flux stream and table functions

Use stream and table functions to extract a table from a stream of tables and access its columns and records.

Example stream and table functions

data = from(bucket:"example-bucket")
  |> range(start: -5m)
  |> filter(fn:(r) => r._measurement == "cpu")

// Extract the "_value" column from the table
data
  |> findColumn(fn: (key) => key._field == "usage_idle", column: "_value")

// Extract the first record from the table
data
  |> findRecord(fn: (key) => key._field == "usage_idle", idx: 0)
Alternate usage
data = from(bucket:"example-bucket")
  |> range(start: -5m)
  |> filter(fn:(r) => r._measurement == "cpu")

// Extract the first available table for which "_field" is equal to "usage_idle"
t = data |> tableFind(fn: (key) => key._field == "usage_idle")

// Extract the "_value" column from the table
values = t |> getColumn(column: "_value")

// Extract the first record from the table
r0 = t |> getRecord(idx: 0)

New! Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: