window.mode

Didukung di:
window.mode(values)

Deskripsi

Menampilkan mode nilai input. Jika ada beberapa kemungkinan nilai mode, hanya salah satu nilai tersebut yang akan dipilih secara non-deterministik sebagai nilai yang ditampilkan.

Jenis data parameter

INT|FLOAT|STRING

Jenis hasil yang ditampilkan

STRING

Contoh kode

Contoh 1

Mendapatkan mode nilai di jendela kecocokan.

// 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