max

max(numericExpression)

說明

max 函式會傳回數值欄中最大值。通常會與 match 搭配使用,以便取得資料中各個群組內的最大值。

參數資料類型

NUMBER

傳回類型

NUMBER

程式碼範例

範例

找出 target.ip 不為空白的所有事件。針對與 principal.ip 相符的所有事件,請將 metadata.event_timestamp.seconds 的最大值儲存在名為 max_seconds 的變數中。

  target.ip != ""
  match:
    principal.ip
  outcome:
    $max_seconds = max(metadata.event_timestamp.seconds)