

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Fluent Bit와 함께 OpenSearch Ingestion 파이프라인 사용
<a name="configure-client-fluentbit"></a>

이 샘플 [Fluent Bit 구성 파일](https://docs.fluentbit.io/manual/pipeline/outputs/http)은 Fluent Bit의 로그 데이터를 OpenSearch Ingestion 파이프라인으로 보냅니다. 로그 데이터 수집에 대한 자세한 내용은 Data Prepper 설명서의 [로그 분석](https://github.com/opensearch-project/data-prepper/blob/main/docs/log_analytics.md)을 참조하세요.

다음 사항에 유의하세요.
+ `host` 값은 파이프라인 엔드포인트여야 합니다. 예를 들어 `pipeline-endpoint.us-east-1osis.amazonaws.com`입니다.
+ `aws_service` 값은 `osis`여야 합니다.
+ `aws_role_arn` 값은 클라이언트가 서명 버전 4 인증에 수임하고 사용할 AWS IAM 역할의 ARN입니다.

```
[INPUT]
  name                  tail
  refresh_interval      5
  path                  /var/log/test.log
  read_from_head        true

[OUTPUT]
  Name http
  Match *
  Host pipeline-endpoint.us-east-1osis.amazonaws.com
  Port 443
  URI /log/ingest
  Format json
  aws_auth true
  aws_region region
  aws_service osis
  aws_role_arn arn:aws:iam::account-id:role/ingestion-role
  Log_Level trace
  tls On
```

그런 다음 HTTP를 소스로 지정하는 다음과 같은 OpenSearch Ingestion 파이프라인을 구성할 수 있습니다.

```
version: "2"
unaggregated-log-pipeline:
  source:
    http:
      path: "/log/ingest"
  processor:
    - grok:
        match:
          log:
            - "%{TIMESTAMP_ISO8601:timestamp} %{NOTSPACE:network_node} %{NOTSPACE:network_host} %{IPORHOST:source_ip}:%{NUMBER:source_port:int} -> %{IPORHOST:destination_ip}:%{NUMBER:destination_port:int} %{GREEDYDATA:details}"
    - grok:
        match:
          details:
            - "'%{NOTSPACE:http_method} %{NOTSPACE:http_uri}' %{NOTSPACE:protocol}"
            - "TLS%{NOTSPACE:tls_version} %{GREEDYDATA:encryption}"
            - "%{NUMBER:status_code:int} %{NUMBER:response_size:int}"
    - delete_entries:
        with_keys: ["details", "log"]

  sink:
    - opensearch:
        hosts: ["https://search-domain-endpoint.us-east-1es.amazonaws.com"]
        index: "index_name"
        index_type: custom
        bulk_size: 20
        aws:
          region: "region"
```