window.stddev

다음에서 지원:
window.stddev(numeric_values)

설명

일치 기간의 입력 값 표준 편차를 반환합니다.

매개변수 데이터 유형

INT|FLOAT

반환 유형

FLOAT

코드 샘플

예 1

이 예시에서는 일치 기간 내의 정수 표준편차를 반환합니다.

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

이 예시에서는 일치 기간 내의 부동 소수점 표준 편차를 반환합니다.

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
예시 3

이 예시에서는 음수가 포함된 일치 기간의 표준 편차를 반환합니다.

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

이 예시에서는 일치 기간의 모든 값이 같으면 표준 편차를 0으로 반환합니다.

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
예시 5

이 예시에서는 양수와 음수가 포함된 일치 기간의 표준 편차를 반환합니다.

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