latest

The latest function returns the latest timestamp from a set of records with microsecond resolution.

Syntax Param data types Return type
latest(timestamp) TIMESTAMP TIMESTAMP

Code sample

  • For all the events that match on hostname, store the latest of metadata.event_timestamp in the end variable.

    $hostname = principal.hostname
    match:
      $hostname
    outcome:
      $end = latest(metadata.event_timestamp)