# Union 연산자

## 개요

로 여러 테이블을 쿼리 `union`.

```kusto
union <table1> [, ...]
```

또는

```kusto
| union <table1> [, ...]
```

사용 `union` 를 사용하여 한 번에 여러 테이블을 쿼리하거나 기존 쿼리에 데이터를 주입할 수 있습니다. 테이블 이름에는 와일드카드 문자 `*` 를 사용해 동일한 데이터베이스나 접미사를 가진 것처럼 이름이 비슷한 테이블을 간결하게 쿼리할 수 있습니다. `union` 는 다음 항목 중 하나입니다. [가능한 PantherFlow 데이터 소스](/ko/pantherflow/statements.md#data-sources).

에서 union을 사용하여 모든 로그를 검색하는 방법에 대해 자세히 알아보세요. [PantherFlow 모범 사례](/ko/pantherflow/best-practices.md#how-to-best-search-across-all-logs-in-pantherflow).

## 예시

{% hint style="info" %}
예시 데이터

```kusto
let aws_alb = datatable [
  {"type": "https", "p_event_time": "2023-09-16 05:45:34.863", "clientIp": "192.168.11.34"},
  {"type": "https", "p_event_time": "2023-09-16 05:59:04.058", "clientIp": "192.168.1.1"},
  {"type": "https", "p_event_time": "2023-09-16 05:36:09.017", "clientIp": "10.168.22.7"}
];

let aws_cloudtrail = datatable [
  {"aws_region": "us-east-2", "p_event_time": "2023-09-16 05:23:30.812", "eventName": "AssumeRole"}
];
```

{% endhint %}

### 여러 소스 테이블 쿼리

```kusto
union aws_alb, aws_cloudtrail
```

| 이벤트                                                                                                   |
| ----------------------------------------------------------------------------------------------------- |
| `{ "p_event_time": "2023-09-16 05:45:34.863", "clientIp": "192.168.11.34", "type": "https" }`         |
| `{ "p_event_time": "2023-09-16 05:59:04.058", "clientIp": "192.168.1.1", "type": "https" }`           |
| `{ "p_event_time": "2023-09-16 05:36:09.017", "clientIp": "10.168.22.7", "type": "https" }`           |
| `{ "p_event_time": "2023-09-16 05:23:30.812", "aws_region": "us-east-2", "eventName": "AssumeRole" }` |

### 기존 쿼리에 테이블 주입

```kusto
aws_alb
// 필요에 따라 여기 다른 문장 추가
| union aws_cloudtrail
```

| 이벤트                                                                                                   |
| ----------------------------------------------------------------------------------------------------- |
| `{ "p_event_time": "2023-09-16 05:45:34.863", "clientIp": "192.168.11.34", "type": "https" }`         |
| `{ "p_event_time": "2023-09-16 05:59:04.058", "clientIp": "192.168.1.1", "type": "https" }`           |
| `{ "p_event_time": "2023-09-16 05:36:09.017", "clientIp": "10.168.22.7", "type": "https" }`           |
| `{ "p_event_time": "2023-09-16 05:23:30.812", "aws_region": "us-east-2", "eventName": "AssumeRole" }` |

### 와일드카드 문자를 사용하여 여러 테이블 쿼리

```kusto
union panther_logs*
```

이 문은 이름이 다음 접두사로 시작하는 모든 테이블을 쿼리합니다 `panther_logs`.


---

# 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/union.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.
