getColumn() function

Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.50 is the most recent stable version of Flux.

The getColumn() function extracts a column from a table given its label. If the label is not present in the set of columns, the function errors.

Function type: Stream and table

getColumn(column: "_value")

Parameters

column

The name of the column to extract.

Data type: String

Example

vs = from(bucket:"telegraf/autogen")
    |> range(start: -5m)
    |> filter(fn:(r) => r._measurement == "cpu")
    |> tableFind(fn: (key) => key._field == "usage_idle")
    |> getColumn(column: "_value")

// Use column values
x = vs[0] + vs[1]