# Join 연산자

## 개요

데이터를 다음으로 풍부하게 하기 `조인`.

```kusto
| join kind=<kind> <dest>=(<target_query>) on <condition>
```

하나의 `조인` 가 수행되면, 파이프의 행은 다음의 행과 매칭됩니다 `<target_query>` 에 기반하여 `<condition>`. 결과 데이터에는 파이프의 모든 원본 필드가 포함되며, 다음의 필드가 `<target_query>` 추가되어 `<dest>` 필드에 들어갑니다. 반환되는 행은 다음에 의해 제어됩니다 `<kind>`.

### `<target_query>`

The `target_query` 는 조인될 데이터입니다. 단순한 테이블 이름과 같은 유효한 쿼리라면 무엇이든 될 수 있습니다 `(some_table)` 또는 더 복잡한 문장 `(some_table | extend id = a + b)`.

### `<condition>`

The `<condition>` 는 파이프의 어떤 행이 다음의 행과 조인될지 제어하는 데 사용되는 식입니다 `<target_query>`. 모든 join에 필요합니다 `<kind>` 를 제외하고 `cross` 조인입니다. 조인에는 `$left` 측(파이프)과 `$right` 측( `<target_query>`)이 있습니다. 예를 들어, 다음 조건은 `$left.id == $right.id` 의 동일한 값을 포함하는 행을 매칭합니다 `id`.

### `<kind>`

다음으로 어떤 행이 출력될지 제어합니다 `kind`.

<table><thead><tr><th width="189">kind 값</th><th>설명</th></tr></thead><tbody><tr><td><code>inner</code></td><td>다음에 일치하는 행만 반환합니다 <code>condition</code>.</td></tr><tr><td><code>leftouter</code></td><td>파이프의 모든 행을 다음의 필드로 풍부하게 하여 반환합니다 <code>target_query</code>, 일치하는 항목이 없는 행은 <code>null</code> 다음의 열에 대해 값을 가집니다 <code>target_query</code>.</td></tr><tr><td><code>rightouter</code></td><td>다음의 모든 행을 반환합니다 <code>target_query</code> 파이프의 필드로 풍부하게 하여 반환하며, 일치하는 항목이 없는 행은 <code>null</code> 파이프의 열에 대해 값을 가집니다.</td></tr><tr><td><code>fullouter</code></td><td>파이프와 다음 양쪽의 행을 반환합니다 <code>target_query</code>, 일치하지 않는 행도 포함합니다.</td></tr><tr><td><code>cross</code></td><td>파이프의 모든 행을 다음의 모든 행과 결합하여 반환합니다 <code>target_query</code> .</td></tr></tbody></table>

## 예시

### IP 주소로 조인

파이프에 다음에 IP 주소가 들어 있다고 가정해 봅시다 `sourceIP` 필드가 있고, 다음 이름의 테이블에 있는 데이터로 이를 풍부하게 하고 싶다고 합시다 `ip_location` 라는 필드에 IP 주소가 들어 있습니다 `ip`.

다음과 같은 조인을 사용할 수 있습니다 `<condition>` 의 `$left.sourceIp == $right.ip` 를 사용하여 IP 주소를 기준으로 행을 매칭하고 `kind=leftouter` 를 사용하여 파이프의 모든 행을 반환합니다. — 다음에서 누락되었을 수 있는 행도 포함됩니다 `ip_location`.

```kusto
<source_table>
| join kind=leftouter ip=(ip_location) on $left.sourceIP == $right.ip
```

### 다음을 사용한 조인 `tor_exit_nodes` 표

이 예시는 다음을 사용합니다 `inner` 조인하여 찾습니다 `aws_alb` 다음을 포함하는 로그 `clientIp` 가 Panther에서 관리하는 목록에 포함된 [`tor_exit_node` Enrichment Provider](/ko/enrichment/tor-exit-nodes.md) 테이블.

```kusto
aws_alb
| join kind=inner tor=(panther_lookups.public.tor_exit_nodes) on        
       $left.clientIp == $right.ip
| limit 10
```

### 다음을 사용한 조인 `ipinfo_location_datalake` UDF를 사용하는 테이블

여기서는 더 복잡한 예시를 살펴보겠습니다. Panther에서 관리하는 [`ipinfo_location_datalake` Enrichment Provider](/ko/enrichment/ipinfo.md) 테이블.

이 쿼리는 다음을 사용한다는 점에 유의하세요 [`snowflake.func`](https://docs.panther.com/ko/pantherflow/operators/pages/0d2f84d8cdf80073c7a4b8cc33d14a602bf4fa72#snowflake.func) 함수를 사용하여 SQL 사용자 정의 함수(UDF)를 호출합니다 `panther_lookups.public.ipinfo_to_join_key()` 및 `panther_lookups.public.ipinfo_to_int()`, 이 함수들은 인수로 IP 주소를 받습니다. 이러한 UDF에 대해 더 알아보려면 다음을 참조하세요 [IPinfo](/ko/enrichment/ipinfo.md#using-a-joinkey).

```kusto
aws_alb
| where p_event_time > time.ago(1d)
| join kind=leftouter ip=(panther_lookups.public.ipinfo_location_datalake) on        
       snowflake.func('panther_lookups.public.ipinfo_to_join_key', $right.joinKey) == snowflake.func('panther_lookups.public.ipinfo_to_join_key', $left.clientIp)
       and snowflake.func('panther_lookups.public.ipinfo_to_int', $left.clientIp) between 
       snowflake.func('panther_lookups.public.ipinfo_to_int', $right.startIP) .. snowflake.func('panther_lookups.public.ipinfo_to_int', $right.endIP)
| project p_event_time, clientIp, city=ip.city, country=ip.country
| limit 10
```

### 다음을 사용한 조인 `datatable`

샘플 데이터를 다음에 주입할 수 있습니다 `조인` 다음을 사용하여 [`datatable`](/ko/pantherflow/operators/datatable.md) 연산자:

```kusto
aws_alb
| join kind=inner system_info=(datatable [{"ip":"192.168.1.1", "hostname":"fluffy"}, {"ip":"192.168.1.2", "hostname":"squishy"}]) on        
       $left.clientIp == $right.ip
| limit 10
```


---

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