选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

将 OpenSearch 采集管道与 Fluentd 配合使用

聚焦模式
将 OpenSearch 采集管道与 Fluentd 配合使用 - 亚马逊 OpenSearch 服务

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

Fluentd是一个开源数据收集生态系统,它提供了 SDKs 不同的语言和子项目,例如Fluent Bit。此示例 Fluentd 配置文件将日志数据从 Fluentd 发送到摄取管道。 OpenSearch 有关摄取日志数据的更多信息,请参阅 Data Prepper 文档中的日志分析

请注意以下几点:

  • endpoint 值必须是管道端点。例如 pipeline-endpoint.us-east-1.osis.amazonaws.com/apache-log-pipeline/logs

  • aws_service 值必须为 osis

  • aws_role_arn值是 AWS IAM 角色的 ARN,供客户端代入并用于签名版本 4 身份验证。

<source> @type tail path logs/sample.log path_key log tag apache <parse> @type none </parse> </source> <filter apache> @type record_transformer <record> log ${record["message"]} </record> </filter> <filter apache> @type record_transformer remove_keys message </filter> <match apache> @type http endpoint pipeline-endpoint.us-east-1.osis.amazonaws.com/apache-log-pipeline/logs json_array true <auth> method aws_sigv4 aws_service osis aws_region us-east-1 aws_role_arn arn:aws:iam::account-id:role/ingestion-role </auth> <format> @type json </format> <buffer> flush_interval 1s </buffer> </match>

然后,您可以配置如下所示的 OpenSearch 采集管道,该管道以 HTTP 为源:

version: "2" apache-log-pipeline: source: http: path: "/${pipelineName}/logs" 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}" sink: - opensearch: hosts: ["https://search-domain-endpoint.us-east-1.es.amazonaws.com"] index: "index_name" aws_sts_role_arn: "arn:aws:iam::account-id:role/pipeline-role" aws_region: "us-east-1" aws_sigv4: true
隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。