數量

count(expression)

說明

count 函式會傳回群組內的列數。通常會與 match 搭配使用,用於取得資料中特定群組的計數。

參數資料類型

STRING

傳回類型

NUMBER

程式碼範例

範例

傳回使用者在一段時間內成功登入的次數。

  metadata.event_type = "USER_LOGIN"
  $security_result = security_result.action
  $security_result = "ALLOW"
  $date = timestamp.get_date(metadata.event_timestamp.seconds, "America/Los_Angeles")
  match:
      $security_result, $date
  outcome:
      $event_count = count(metadata.id)