# 배열 함수

{% hint style="info" %}
PantherFlow는 Panther 버전 1.110부터 공개 베타로 제공되며, 모든 고객이 사용할 수 있습니다. 버그 신고와 기능 요청은 Panther 지원팀에 공유해 주세요.
{% endhint %}

## `arrays.difference()`

`arrays.difference(arr: [any], excluded_arr: [any]) -> [any]`

다음 요소들을 포함하는 배열을 반환합니다. `arr` 에 없는 `excluded_arr`.

**예시:**

```kusto
panther_logs.public.aws_alb
| project ips=arrays.difference(p_any_ip_addresses, p_any_trace_ids)
```

## `arrays.filter()`

`arrays.filter(array: [any], func: fn) -> [any]`

다음에 대해 `func` 를 각 요소마다 실행하고 `배열` 에서 true를 반환하는 요소만 포함한 새 배열을 반환합니다. `func` 함수 정의에 대해 자세히 알아보세요. [PantherFlow 표현식](https://docs.panther.com/pantherflow/expressions#functions).

**예시:**

```kusto
datatable [{"a": [1, 2, 3]}]
| extend a_even=arrays.filter(a, fn (elem) { elem % 2 == 0 })
```

## `arrays.flatten()`

`arrays.flatten(array: [any]) -> [any]`

다음 경우 `배열` 가 배열의 배열이라면, 내부 배열의 모든 요소를 포함하는 단일 배열을 반환합니다.

**예시:**

```kusto
datatable [{"a": [[1, 2], [3]]}]
| extend a_flattened=arrays.flatten(a)
```

## `arrays.intersection()`

`arrays.intersection(arr1: [any], arr2: [any]) -> [any]`

다음 두 배열 모두에 있는 요소만 포함하는 배열을 반환합니다. `arr1` 및 `arr2`.

**예시:**

```kusto
panther_logs.public.aws_alb
| project ips=arrays.intersection(p_any_ip_addresses, p_any_trace_ids)
```

## `arrays.len()`

`arrays.len(arr: [any]) -> int`

의 길이를 반환합니다. `arr`만약 `arr` 배열이 아니면 먼저 JSON화됩니다.

**예시:**

```kusto
panther_logs.public.aws_alb
| project ipsFound=arrays.len(p_any_ip_addresses)
```

## `arrays.map()`

`arrays.map(array: [any], func: fn) -> [any]`

다음에 대해 `func` 의 각 요소에 대해 `배열` 를 실행하고 결과 배열을 반환합니다. 함수 정의에 대해 자세히 알아보세요. [PantherFlow 표현식](https://docs.panther.com/pantherflow/expressions#functions).

**예시:**

```kusto
datatable [{"a": [1, 2, 3]}]
| extend a_plus_one=arrays.map(a, fn (elem) { elem + 1 })
```

## `arrays.overlap()`

`arrays.overlap(arr1: [any], arr2: [any]) -> bool`

다음이면 true를 반환합니다 `arr1` 및 `arr2` 공통된 요소가 하나라도 있습니다.

**예시:**

```kusto
panther_logs.public.aws_alb
| project tracesHadIps=arrays.overlap(p_any_ip_addresses, p_any_trace_ids)
```

## `arrays.sort()`

`arrays.sort(arr: [any] [, sort_asc: bool] [, nulls_first: bool]) -> [any]`

입력 배열의 요소를 포함하며 `arr` 오름차순 또는 내림차순으로 정렬된 배열을 반환합니다. 기본값은 오름차순입니다. null 요소를 비-null 요소보다 앞에 둘지 뒤에 둘지 지정할 수 있습니다. 기본값은 오름차순에서는 null이 뒤, 내림차순에서는 null이 앞입니다.

**예시:**

```kusto
panther_logs.public.aws_alb
| project tracesSorted=arrays.sort(p_any_trace_ids, false)
```

## `arrays.union()`

`arrays.union(arr1: [any], arr2: [any]) -> [any]`

다음의 중복 제거된 모든 요소를 포함하는 배열을 반환합니다. `arr1` 및 `arr2`.

**예시:**

```kusto
panther_logs.public.aws_alb
| project ips=arrays.union(p_any_ip_addresses, p_any_trace_ids)
```


---

# 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/functions/array.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.
