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