Docs

v2.0

keys() function

The keys() function outputs the group key of input tables. For each input table, it outputs a table with the same group key columns, plus a _value column containing the labels of the input table’s group key. Each row in an output table contains the group key value and the label of one column in the group key of the input table. Each output table has the same number of rows as the size of the group key of the input table.

Function type: Transformation

keys(column: "_value")

Parameters

column

The name of the output column in which to store the group key labels. Defaults to "_value".

Data type: String

Examples

from(bucket: "telegraf/autogen")
  |> range(start: -30m)
  |> keys(column: "keys")
Return every possible key in a single table
from(bucket: "telegraf/autogen")
    |> range(start: -30m)
    |> keys()
    |> keep(columns: ["_value"])
    |> group()
    |> distinct()

SHOW MEASUREMENTS
SHOW FIELD KEYS
SHOW TAG KEYS
SHOW SERIES


Bug Reports and Feedback

Thank you for being willing to help test InfluxDB v2.0 alpha! Feedback and bug reports are welcome and encouraged both for InfluxDB and this documentation.

Submit feedback in the InfluxData Community