drop() function

Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.36 is the most recent stable version of Flux.

The drop() function removes specified columns from a table. Columns are specified either through a list or a predicate function. When a dropped column is part of the group key, it will be removed from the key.

Function type: Transformation
Output data type: Object

drop(columns: ["col1", "col2"])

// OR

drop(fn: (column) => column =~ /usage*/)

Parameters

columns

Columns to be removed from the table. Cannot be used with fn.

Data type: Array of strings

fn

A function which takes a column name as a parameter (column) and returns a boolean indicating whether or not the column should be removed from the table. Cannot be used with columns.

Data type: Function

Examples

Drop a list of columns
from(bucket: "telegraf/autogen")
	|> range(start: -5m)
	|> drop(columns: ["host", "_measurement"])
Drop columns matching a predicate
from(bucket: "telegraf/autogen")
  |> range(start: -5m)
  |> drop(fn: (column) => column =~ /usage*/)

DROP MEASUREMENT