InfluxDB Docs

first() function

The first() function selects the first non-null record from an input table.

Function type: Selector
Output data type: Object

first()

Examples

from(bucket:"example-bucket")
  |> range(start:-1h)
  |> filter(fn: (r) =>
    r._measurement == "cpu" and
    r._field == "usage_system"
  )
  |> first()

FIRST()