# Summarize 연산자

## 개요

다음과 함께 집계 결과를 확인합니다 `요약`.

```kusto
| summarize [[<dest>=]aggregation[, ...]] by [<dest>=]<expression>[, ...] 
```

다음을 포함한 많은 집계를 지원합니다:

* [`agg.avg()`](https://docs.panther.com/ko/pantherflow/operators/pages/c558177b40b82223aa5247e48b550d9e8e0ee9b1#agg.avg)
* [`agg.count()`](https://docs.panther.com/ko/pantherflow/operators/pages/c558177b40b82223aa5247e48b550d9e8e0ee9b1#agg.count)
* [`agg.count_distinct()`](https://docs.panther.com/ko/pantherflow/operators/pages/c558177b40b82223aa5247e48b550d9e8e0ee9b1#agg.count_distinct)
* [`agg.make_set()`](https://docs.panther.com/ko/pantherflow/operators/pages/c558177b40b82223aa5247e48b550d9e8e0ee9b1#agg.make_set)
* [`agg.max()`](https://docs.panther.com/ko/pantherflow/operators/pages/c558177b40b82223aa5247e48b550d9e8e0ee9b1#agg.max)
* [`agg.min()`](https://docs.panther.com/ko/pantherflow/operators/pages/c558177b40b82223aa5247e48b550d9e8e0ee9b1#agg.min)
* [`agg.percentile_cont()`](https://docs.panther.com/ko/pantherflow/operators/pages/c558177b40b82223aa5247e48b550d9e8e0ee9b1#agg.percentile_cont)
* [`agg.stddev()`](https://docs.panther.com/ko/pantherflow/operators/pages/c558177b40b82223aa5247e48b550d9e8e0ee9b1#agg.stddev)
* [`agg.sum()`](https://docs.panther.com/ko/pantherflow/operators/pages/c558177b40b82223aa5247e48b550d9e8e0ee9b1#agg.sum)
* [`agg.take_any()`](https://docs.panther.com/ko/pantherflow/operators/pages/c558177b40b82223aa5247e48b550d9e8e0ee9b1#agg.take_any)

사용 가능한 집계의 전체 목록은 다음에서 확인하세요 [집계 함수](/ko/pantherflow/functions/aggregation.md).

## 예시

### 개수

다음 쿼리는 필드에 저장된 지난 하루 동안의 모든 이벤트 수를 표시합니다 `num_connections`:

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.ago(1d)
| summarize num_connections=agg.count()
```

| num\_connections |
| ---------------- |
| 993              |

### 단일 필드별 그룹 개수

다음 쿼리는 각 항목에 대한 연결 수를 계산합니다 `clientIp` 그리고 연결 수가 가장 많은 순서대로 결과를 정렬합니다:

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.ago(1d)
| summarize num_connections=agg.count() by clientIp
| sort num_connections
```

| clientIp     | num\_connections |
| ------------ | ---------------- |
| 192.167.7.55 | 979              |
| 10.145.4.26  | 130              |
| 10.99.231.15 | 31               |
| ...          |                  |

### 여러 필드별 그룹 개수

다음 쿼리는 다음을 표시합니다 `num_connections` 다음 두 항목으로 그룹화된 `clientIp` 및 `clientPort` fields:

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.ago(1d)
| summarize num_connections=agg.count() by clientIp, clientPort
| sort num_connections
```

| clientIp     | clientPort | num\_connections |
| ------------ | ---------- | ---------------- |
| 192.167.7.55 | 50160      | 7                |
| 10.145.4.26  | 63335      | 5                |
| 10.145.4.26  | 60845      | 4                |
| 192.167.7.55 | 52138      | 4                |
| 10.99.231.15 | 58704      | 3                |
| …            |            |                  |

### 임의의 표현식별 그룹 개수

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.ago(1d)
| summarize num_connections=agg.count() by isOK = elbStatusCode == 200
| sort num_connections
```

| isOK  | num\_connections |
| ----- | ---------------- |
| true  | 1114             |
| false | 324              |

### 고유 개수

아래 쿼리는 다음의 고유한 개수를 저장합니다 `clientIp`s를 `num_distinct_clients`:

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.ago(1d)
| summarize num_distinct_clients=agg.count_distinct(clientIp)
```

| num\_distinct\_clients |
| ---------------------- |
| 121                    |

### 나중에 집계를 참조하기

이후 쿼리 표현식에서 집계를 참조할 수 있습니다:

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.ago(1d)
| summarize num_connections=agg.count() by clientIp, clientPort
| where num_connections >= 5
```

| clientIp     | clientPort | num\_connections |
| ------------ | ---------- | ---------------- |
| 192.167.7.55 | 50160      | 7                |
| 10.145.4.26  | 63335      | 5                |
| ...          |            |                  |

### 필드별 요약(집계 없음)

아래 쿼리는 각 고유한 `userAgent`:

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.ago(1d)
| summarize by userAgent
```

| userAgent                                                                                                                              |
| -------------------------------------------------------------------------------------------------------------------------------------- |
| Mozilla/5.0 (X11; Linux x86\_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36                              |
| curl/8.1.2                                                                                                                             |
| Mozilla/5.0 (Linux; Android 7.0; LG-H918 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36 |
| …                                                                                                                                      |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.panther.com/ko/pantherflow/operators/summarize.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
