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