getColumn() function

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")

Use tableFind() to extract a single table

getColumn() requires a single table as input. Use tableFind() to extract a single table from a stream of tables.



Name of the column to extract.

Data type: String


vs = from(bucket:"example-bucket")
    |> 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]

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: