

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# OpenSearch Ingestion パイプラインを Fluent Bit で使用する
<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"
```