그룹

다음에서 지원:
group(field1, field2, field3, ...)

설명

유사한 유형의 필드를 자리표시자 변수로 그룹화합니다.

UDM 검색에서 그룹화된 필드는 비슷한 유형의 여러 필드를 검색하는 데 사용됩니다. 그룹 함수는 감지를 트리거하기 위해 함께 그룹화할 필드를 선택할 수 있다는 점을 제외하면 그룹화된 필드와 유사합니다. 그룹 함수를 사용하여 여러 명사 유형에서 특정 항목(예: 호스트 이름, IP 주소 또는 userid)에 대한 정보를 수집할 수 있습니다.

  • 매개변수 유형: Event type

  • 반환 유형: Grouped event fields

코드 샘플

예: IP 주소 집계 및 개수

모든 IP 주소를 함께 그룹화하고 스캔된 기간 동안 가장 많이 사용되는 IP 주소의 개수를 내림차순으로 제공합니다.

$ip = group(principal.ip, about.ip, target.ip)
$ip != ""
match:
  $ip

outcome:
  $count = count_distinct(metadata.id)

order:
  $count desc

예: 각 IP 주소의 고유 이벤트 수 계산

다음 예에서 group() 함수는 감지를 트리거한 모든 이벤트에서 principal.ip, target.ip, src.ip 필드에 있는 모든 IP 주소를 수집합니다. 그런 다음 IP 주소가 자리표시자 변수 $ip에 추가됩니다. 그런 다음 규칙은 IP 주소를 일치시키고 각 고유 IP 주소의 개별 이벤트 수를 반환합니다.

$ip = group(detection.collection_elements.references.event.principal.ip, detection.collection_elements.references.event.target.ip, detection.collection_elements.references.event.src.ip)
$ip != ""

match:
  $ip

outcome:
  $count = count_distinct(detection.id)

order:
  $count desc

// Detection1: principal.ip = 1.1.1.1
// Detection2: src.ip = 1.1.1.1, target.ip = 2.2.2.2
// Detection3: target.ip = 1.1.1.1
// Detection4: principal.ip = 2.2.2.2

결과:

$ip $count
1.1.1.1 3
2.2.2.2 2