window.stddev

Unterstützt in:
window.stddev(numeric_values)

Beschreibung

Gibt die Standardabweichung der Eingabewerte in einem Abgleichszeitraum zurück.

Parameterdatentypen

INT|FLOAT

Rückgabetyp

FLOAT

Codebeispiele

Beispiel 1

In diesem Beispiel wird die Standardabweichung von Ganzzahlen in einem Abgleichszeitraum zurückgegeben.

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

In diesem Beispiel wird die Standardabweichung von Gleitkommazahlen in einem Abgleichszeitraum zurückgegeben.

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
Beispiel 3

In diesem Beispiel wird die Standardabweichung in einem Abgleichszeitraum mit negativen Zahlen zurückgegeben.

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
Beispiel 4

In diesem Beispiel wird eine Standardabweichung von null zurückgegeben, wenn alle Werte im Abgleichszeitraum gleich sind.

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
Beispiel 5

In diesem Beispiel wird die Standardabweichung eines Abgleichszeitraums mit positiven und negativen Zahlen zurückgegeben.

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