count

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

語法 參數資料類型 傳回類型
count(expression) 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)