duplicate() function

The duplicate() function duplicates a specified column in a table. If the specified column is part of the group key, it will be duplicated, but will not be part of the output table’s group key.

Function type: Transformation
Output data type: Record

duplicate(column: "column-name", as: "duplicate-name")



The column to duplicate.

Data type: String


The name assigned to the duplicate column.

Data type: String

If the as column already exists, this function will overwrite the existing values.


from(bucket: "example-bucket")
	|> range(start:-5m)
	|> filter(fn: (r) => r._measurement == "cpu")
	|> duplicate(column: "host", as: "server")

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: