set() function

The set() function assigns a static value to each record in the input table. The key may modify an existing column or add a new column to the tables. If the modified column is part of the group key, the output tables are regrouped as needed.

Function type: Transformation
Output data type: Record

set(key: "myKey",value: "myValue")



The label of the column to modify or set.

Data type: String


The string value to set.

Data type: String


from(bucket: "example-bucket")
  |> set(key: "host", value: "prod-node-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: