sum

The sum function returns the sum of values within a numeric column. It ignores NULL values during the calculation. It is often used with match to calculate the sums within different groups in the data.

Syntax Param data types Return type
sum(numericExpression) NUMBER NUMBER

Code Sample

  • Find all the events where target.ip is not empty. For all the events that match on principal.ip, store a sum of network.sent_bytes in a variable called sent_bytes.

    target.ip != ""
    match:
      principal.ip
    outcome:
      $sent_bytes = sum(network.sent_bytes)