# PantherFlow 표현식

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

## 참조

### 배열 참조

<table><thead><tr><th width="173.33333333333331">구문</th><th width="200">설명</th><th>예제</th></tr></thead><tbody><tr><td><code>array[X]</code></td><td>X의 값 가져오기</td><td><code>foo[1]</code></td></tr></tbody></table>

### 개체 참조

<table><thead><tr><th width="173.33333333333331">구문</th><th width="200">설명</th><th>예제</th></tr></thead><tbody><tr><td><code>object['X']</code></td><td>X의 값 가져오기</td><td><code>foo['bar']</code></td></tr><tr><td><code>object.X</code></td><td>X의 값 가져오기</td><td><code>foo.bar</code></td></tr></tbody></table>

## 비교

### 동등 비교

<table><thead><tr><th width="145.33333333333331">연산자</th><th width="172">설명</th><th>예제</th><th data-hidden>연산자</th><th data-hidden>의미</th></tr></thead><tbody><tr><td><code>==</code></td><td>동등</td><td><code>A == B</code></td><td>==</td><td></td></tr><tr><td><code>!=</code></td><td>부등</td><td><code>A != B</code></td><td>!=</td><td></td></tr></tbody></table>

### 불리언 비교

<table><thead><tr><th width="149.33333333333331">연산자</th><th width="158">설명</th><th>예제</th><th data-hidden>연산자</th><th data-hidden>의미</th></tr></thead><tbody><tr><td><code>Run Panther AI</code></td><td>논리 AND</td><td><code>A and B</code></td><td>Run Panther AI</td><td></td></tr><tr><td><code>또는</code></td><td>논리 OR</td><td><code>A or B</code></td><td>또는</td><td></td></tr><tr><td><code>not</code></td><td>논리 NOT</td><td><code>not A</code></td><td>not</td><td></td></tr></tbody></table>

### 수치 비교

<table><thead><tr><th width="126.33333333333331">구문</th><th width="245">설명</th><th>예제</th></tr></thead><tbody><tr><td><code>&#x3C;</code></td><td>보다 작음</td><td><code>A &#x3C; B</code></td></tr><tr><td><code>&#x3C;=</code></td><td>보다 작거나 같음</td><td><code>A &#x3C;= B</code></td></tr><tr><td><code>></code></td><td>보다 큼</td><td><code>A > B</code></td></tr><tr><td><code>>=</code></td><td>보다 크거나 같음</td><td><code>A >= B</code></td></tr><tr><td><code>+</code></td><td>더하기</td><td><code>A + B</code></td></tr><tr><td><code>-</code></td><td>빼기</td><td><code>A - B</code></td></tr><tr><td><code>*</code></td><td>곱하기</td><td><code>A * B</code></td></tr><tr><td><code>/</code></td><td>나누기</td><td><code>A / B</code></td></tr><tr><td><code>%</code></td><td>나머지</td><td><code>A % B</code></td></tr></tbody></table>

### 배열 비교

<table><thead><tr><th width="142.33333333333331">구문</th><th width="194">설명</th><th>예제</th></tr></thead><tbody><tr><td><code>in</code></td><td>값이 배열 안에 있음</td><td><code>X in [X, Y, Z]</code>, <code>'10.10.10.100' in p_any_ip_addresses</code></td></tr><tr><td><code>not in</code></td><td>값이 배열 안에 없음</td><td><code>X not in [A, B, C]</code></td></tr></tbody></table>

### 범위 비교

<table><thead><tr><th width="166">연산자</th><th width="248">설명</th><th>예제</th></tr></thead><tbody><tr><td><code>between</code></td><td>값이 두 값 사이에 있음(포함), 값들은 다음으로 구분됨 <code>..</code></td><td><code>&#x3C;foo> between &#x3C;begin> .. &#x3C;end></code></td></tr><tr><td><code>not between</code></td><td>값이 두 값 사이에 없음(미포함), 값들은 다음으로 구분됨 <code>..</code></td><td><code>&#x3C;foo> not between &#x3C;begin> .. &#x3C;end></code></td></tr></tbody></table>

## 함수

### 익명 함수

익명 함수, 또는 "람다 함수"는 이름 없는 함수로, 다음의 인자로 사용할 수 있습니다. `arrays.map()` Run Panther AI `arrays.filter()` 함수. 익명 함수는 0개 이상의 매개변수와 표현식인 본문을 가집니다:

```kusto
fn ([arg1] [, arg2...]]) { <expr> }
```

#### 예시: **에서 숫자에 1 더하기 `arrays.map()`**

아래 예제에서 익명 함수는 첫 번째 인자로 제공된 배열의 각 요소에 적용됩니다. `arrays.map()`:

```kusto
arrays.map([1, 2, 3], fn (r) { r + 1 })
```

이후 `arrays.map()` 함수가 각 요소에 적용되면, 배열은 다음과 같이 됩니다:

```kusto
[2, 3, 4]
```

#### **예: null과 비교하기 `arrays.filter()`**

아래 예제에서, `arrays.filter()` 익명 함수를 필터 조건으로 사용합니다:

```kusto
arrays.filter([null, 5, null, 6], fn (elem) { elem != null })
```

이후 `arrays.filter()` 익명 함수를 사용해 목록을 필터링하면, 다음과 같이 됩니다:

```kusto
[5, 6]
```

#### **예: 여러 익명 함수 중첩하기**

익명 함수를 중첩하거나, 다른 익명 함수의 본문에서 익명 함수를 사용하는 것이 가능합니다. 이는 배열 안의 배열을 추출할 때 유용할 수 있습니다:

```kusto
let source = datatable [{
  "results": [
    {
      "cats": [
        {
          "Name": "Whiskers",
          "Breed": "Siamese",
          "FurLength": "Short",
          "ID": "AAAAA"
        },
        {
          "Name": "Mittens",
          "Breed": "Maine Coon",
          "FurLength": "Long",
          "ID": "BBBBB"
        }
      ]
    },
    {
      "cats": [
        {
          "Name": "Mr. Meow",
          "Breed": "Orange Tabby",
          "FurLength": "Short",
          "ID": "CCCCC"
        },
        {
          "Name": "Mrs. Meow",
          "Breed": "Persian",
          "FurLength": "Long",
          "ID": "DDDDD"
        }
      ]
    }
  ]
}];

source
| project results=arrays.flatten(
    arrays.map(results, fn (result) { 
        arrays.map(result.cats, fn (cat) { 
            object("CatName", cat.Name, "ID", cat.ID) 
        })
    })
)
```

| results                                                                                                                                             |
| --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[{"CatName":"Whiskers","ID":"AAAAA"},{"CatName":"Mittens","ID":"BBBBB"},{"CatName":"Mr. Meow","ID":"CCCCC"},{"CatName":"Mrs. Meow","ID":"DDDDD"}]` |


---

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