window.mode

支持的语言:
window.mode(values)

说明

返回输入值的众数。如果存在多个可能的众数值,则只会以不确定的方式选择其中一个值作为返回值。

形参数据类型

INT|FLOAT|STRING

返回类型

STRING

代码示例

示例 1

获取匹配窗口中值的众数。

// This rule sets the outcome $size_mode to the most frequently occurring
// file size in the 5 minute match window.
events:
 $e.user.userid = $userid
match:
 $userid over 5m
outcome:
  $size_mode = window.mode($e.file.size) // yields 1.6 if the event file size values in the match window are 1.6, 2, and 1.6