keyValues() function
The keyValues()
function returns a table with the input table’s group key plus two columns,
_key
and _value
, that correspond to unique column + value pairs from the input table.
Function type: Transformation
keyValues(keyColumns: ["usage_idle", "usage_user"])
Parameters
keyColumns
A list of columns from which values are extracted.
All columns indicated must be of the same type.
Each input table must have all of the columns listed by the keyColumns
parameter.
Data type: Array of strings
Examples
Get key values from explicitly defined columns
from(bucket: "example-bucket")
|> range(start: -30m)
|> filter(fn: (r) => r._measurement == "cpu")
|> keyValues(keyColumns: ["usage_idle", "usage_user"])
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, the following resources are available:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.