filter() function

*Function type: Transformation
**
Output data type:* Record

Make sure fn parameter names match each specified parameter. To learn why, see .

A single argument predicate function that evaluates true or false. Records are passed to the function. Those that evaluate to true are included in the output tables. Records that evaluate to null or false are not included in the output tables.

Records evaluated in functions are represented by r, short for “record” or “row”.

onEmpty

Defines the behavior for empty tables. Potential values are keep and . Defaults to drop.

*Data type: String*

drop
keep

Tables without rows are output to the next transformation.

Keeping empty tables with your first filter() function can have severe performance costs since it retains empty tables from your entire data set. For higher performance, use your first function to do basic filtering, then keep empty tables on subsequent filter() calls with smaller data sets. .

Examples

Filter based on measurement, field, and tag
Filter out null values
Filter values based on thresholds
Keep empty tables when filtering

Related articles