window.stddev

Didukung di:
window.stddev(numeric_values)

Deskripsi

Menampilkan simpangan baku nilai input dalam jendela kecocokan.

Jenis data parameter

INT|FLOAT

Jenis hasil yang ditampilkan

FLOAT

Contoh kode

Contoh 1

Contoh ini menampilkan simpangan baku bilangan bulat dalam jendela kecocokan.

// This rule creates a detection when the file size stddev in 5 minutes for a user is over a threshold.
events:
 $e.user.userid = $userid
match:
 $userid over 5m
outcome:
  $p1 = window.stddev($e.file.size) // yields 4.0 if the event file size values in the match window are [10, 14, 18].
condition:
  $e and #p1 > 2
Contoh 2

Contoh ini menampilkan simpangan baku float dalam jendela pencocokan.

events:
 $e.user.userid = $userid
match:
 $userid over 5m
outcome:
  $p1 = window.stddev($e.file.size) // yields 4.488686 if the event file size values in the match window are [10.00, 14.80, 18.97].
condition:
  $e and #p1 > 2
Contoh 3

Contoh ini menampilkan simpangan baku dalam jendela kecocokan yang berisi angka negatif.

events:
 $e.user.userid = $userid
match:
 $userid over 5m
outcome:
  $p1 = window.stddev($e.file.size) // yields 48.644972 if the event file size values in the match window are [-1, -56, -98].
condition:
  $e and #p1 > 2
Contoh 4

Contoh ini menampilkan simpangan baku nol jika semua nilai dalam jendela kecocokan sama.

events:
 $e.user.userid = $userid
match:
 $userid over 5m
outcome:
  $p1 = window.stddev($e.file.size) // yields 0.000000 if the event file size values in the match window are [1, 1, 1].
condition:
  $e and #p1 > 2
Contoh 5

Contoh ini menampilkan simpangan baku jendela kecocokan yang berisi angka positif dan negatif.

events:
 $e.user.userid = $userid
match:
 $userid over 5m
outcome:
  $p1 = window.stddev($e.file.size) // yields 1.000000 if the event file size values in the match window are [1, 0, -1].
condition:
  $e and #p1 > 10