min

min 函式會傳回數值欄中的最小值。這項函式通常會與 match 搭配使用,取得資料中每個群組的最小值。

語法 參數資料類型 傳回類型
min(numericExpression) NUMBER NUMBER

程式碼範例

  • 找出 target.ip 不為空白的所有事件。針對所有符合 principal.ip 的事件,將 metadata.event_timestamp.seconds 的最小值儲存在名為 min_seconds 的變數中。

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