> For the complete documentation index, see [llms.txt](https://docs.panther.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.panther.com/ko/data-onboarding/custom-log-types/fastmatch-parser.md).

# Fastmatch 로그 파서

## 개요

해당 `fastmatch` 파서는 로그 라인 내 필드의 위치를 지정하는 단순한 문자열 패턴을 사용합니다. 이름에서 알 수 있듯이 매우 빠르며, 텍스트 로그를 파싱하는 데 선호되는 방법으로 간주해야 합니다. 필드의 순서를 알고 있는 대부분의 구조화된 텍스트 로그 사례를 처리할 수 있습니다. 사실 매우 빨라서 순서대로 테스트될 여러 패턴을 지정할 수 있으므로, 로그 라인 구조에 약간의 변형이 있는 경우도 '해결'할 수 있습니다.

### fastmatch 사용 예시

다음은 Apache Common Log 형식을 사용하는 예제 로그 라인입니다:

```
127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326
```

다음은 이 로그 유형에 대한 로그 스키마를 다음을 사용하여 정의하는 방법입니다 `fastmatch`:

{% tabs %}
{% tab title="콘솔 " %}
Panther 콘솔에서 다음을 따르면 됩니다 [수동으로 사용자 지정 스키마를 만드는 방법 안내](/ko/data-onboarding/custom-log-types.md#how-to-create-a-custom-schema-manually), **FastMatch** 파서.

<figure><img src="/files/f6a993d3e39f0c3e2e63b2f54d8885f16fd07dc4" alt="In a &#x22;Schema&#x22; section, &#x22;FastMatch&#x22; is selected for a Parser field. There are various form fields shown, such as Match Patterns, Empty Values, and Skip Prefix."><figcaption></figcaption></figure>

다음의 **필드 및 지표** 섹션(위 스크린샷에 표시된 **파서** 섹션 아래), 필드를 다음과 같이 정의합니다:

```yaml
fields:
  - 이름: remote_ip
    type: string
    표시자:
      - ip
  - 이름: identity
    type: string
  - 이름: user
    type: string
  - 이름: timestamp
    type: timestamp
    isEventTime: true
    timeFormats:
     - '%d/%b/%Y:%H:%M:%S %z'
  - 이름: method
    type: string
  - name: request_uri
    type: string
  - 이름: protocol
    type: string
  - 이름: status
    유형: int
  - name: bytes_sent
    type: bigint
```

{% endtab %}

{% tab title="전체 YAML 표현" %}

```yaml
파서:
  fastmatch:
    # 일치시킬 패턴의 배열을 정의합니다.
    # 이 예제에서는 모든 행의 로그 형식이 동일하므로 하나의 패턴만 사용합니다.
    # Apache Extended Log 형식을 포함하려면 추가 패턴을 제공할 수 있습니다.
    match:
      - '%{remote_ip} %{identity} %{user} [%{timestamp}] "%{method} %{request_uri} %{protocol}" %{status} %{bytes_sent}'
    emptyValues: [ '-' ] # `-` 문자열 값이 null로 간주되도록 지정합니다
fields:
  - 이름: remote_ip
    type: string
    표시자:
      - ip
  - 이름: identity
    type: string
  - 이름: user
    type: string
  - 이름: timestamp
    type: timestamp
    isEventTime: true
    timeFormats:
     - '%d/%b/%Y:%H:%M:%S %z'
  - 이름: method
    type: string
  - name: request_uri
    type: string
  - 이름: protocol
    type: string
  - 이름: status
    유형: int
  - name: bytes_sent
    type: bigint
```

{% endtab %}
{% endtabs %}

## fastmatch 패턴 이해하기

패턴은 `%{field_name}` 플레이스홀더를 사용하여 로그 라인에서 필드가 예상되는 위치를 지정합니다. 예를 들어, 다음 텍스트와 일치시키려면:

```
2020-10-10T14:32:05 [FOO_SERVICE@127.0.0.1] [DEBUG] "" Something when wrong
```

다음 패턴을 사용할 수 있습니다(명확성을 위해 작은따옴표로 감쌌습니다):

```yaml
' %{timestamp} [%{service}@%{ip}] [%{log_level}] %{message}'
```

Panther 콘솔에서 스키마를 정의하는 경우, 패턴을 다음 항목에 입력합니다. **일치 패턴** 필드:

<figure><img src="/files/3e34dec809b75a31e1e3989cf91287240a6307ef" alt="A &#x22;Match Patterns&#x22; field is shown. Its description is, &#x22;Define patterns to match log entries and extract structured information from unstructured log lines.&#x22;"><figcaption></figcaption></figure>

### 구분자

연속된 두 필드 사이의 텍스트가 그 사이의 '구분자'를 정의합니다. 구분자는 비어 있을 수 없습니다.

위 예제의 패턴에서는 다음을 생략할 수 없습니다 `"@"` 사이에 `service` 그리고 `ip`.

필드 *앞의* 구분자에는 구분자 텍스트가 포함될 수 없습니다. 위 예제에서는:

* `timestamp` 공백을 포함할 수 없습니다 `" "`
* `service` 포함할 수 없습니다 `"@"`
* `ip` 포함할 수 없습니다 `"] ["`
* `log_level` 포함할 수 없습니다 `"] "`

### 익명 필드

이름이 없는 필드 플레이스홀더(`%{}`)는 무시됩니다.

### 꼬리 캡처

패턴의 마지막 필드 뒤에 구분자 텍스트가 없으면 *뒤에* 그 필드는 캡처합니다 *모든 것* 텍스트 끝까지의 내용을. 위 예제에서는 `message` 캡처합니다 `"Something when wrong"`

### 따옴표 처리

경우에 따라 필드는 텍스트 안에서 따옴표로 감싸질 수 있습니다:

```
2020-10-10T14:32:05 "Some quoted text with \"escaped quotes\" inside"
```

이러한 필드를 올바르게 이스케이프 해제하려면 필드 플레이스홀더를 따옴표로 감싸기만 하면 됩니다:

```
%{timestamp} "%{message}"
```

이는 홑따옴표와 큰따옴표 모두에 적용됩니다.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.panther.com/ko/data-onboarding/custom-log-types/fastmatch-parser.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
