使用蓝图创建管道 - 亚马逊 OpenSearch 服务

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

使用蓝图创建管道

不要从头开始创建管道定义,而是使用配置蓝图,这些蓝图是针对常见提取场景(例如 Trace Analytics 或 Apache 日志)的预调配 YAML 模板。配置蓝图可帮助您轻松预调配管道,而不必从头开始编写配置。

要使用管道蓝图
  1. 登录到位于 https://console.aws.amazon.com/aos/home 的 Amazon OpenSearch Service 控制台。

  2. 在左侧导航窗格中选择管道,然后选择创建管道

  3. 从用例列表中选择蓝图,然后选择选择蓝图。管道配置会填充您所选用例的子管道。

  4. 查看注释的文本,该文本将指导您完成蓝图的配置。

    重要

    初始的管道蓝图是无效的。您需要进行一些修改,例如提供 AWS 区域 和角色 ARN 以用于身份验证,否则管道验证将失败。

要使用 AWS CLI 获取所有可用蓝图的列表,请发送 list-pipeline-blueprints 请求。

aws osis list-pipeline-blueprints

该请求返回所有可用蓝图的列表。

要获取有关某个具体蓝图的更多详细信息,请使用 get-pipeline-blueprint 命令:

aws osis get-pipeline-blueprint --blueprint-name AWS-ApacheLogPipeline

该请求返回 Apache 日志管道蓝图的内容:

{ "Blueprint":{ "PipelineConfigurationBody":"###\n # Limitations: https://docs.aws.amazon.com/opensearch-service/latest/ingestion/ingestion.html#ingestion-limitations\n###\n###\n # apache-log-pipeline:\n # This pipeline receives logs via http (e.g. FluentBit), extracts important values from the logs by matching\n # the value in the 'log' key against the grok common Apache log pattern. The grokked logs are then sent\n # to OpenSearch to an index named 'logs'\n###\n\nversion: \"2\"\napache-log-pipeline:\n source:\n http:\n # Provide the path for ingestion. ${pipelineName} will be replaced with pipeline name configured for this pipeline.\n # In this case it would be \"/apache-log-pipeline/logs\". This will be the FluentBit output URI value.\n path: \"/${pipelineName}/logs\"\n processor:\n - grok:\n match:\n log: [ \"%{COMMONAPACHELOG_DATATYPED}\" ]\n sink:\n - opensearch:\n # Provide an AWS OpenSearch Service domain endpoint\n # hosts: [ \"https://search-mydomain-1a2a3a4a5a6a7a8a9a0a9a8a7a.us-east-1.es.amazonaws.com\" ]\n aws:\n # Provide a Role ARN with access to the domain. This role should have a trust relationship with osis-pipelines.amazonaws.com\n # sts_role_arn: \"arn:aws:iam::123456789012:role/Example-Role\"\n # Provide the region of the domain.\n # region: \"us-east-1\"\n # Enable the 'serverless' flag if the sink is an Amazon OpenSearch Serverless collection\n # serverless: true\n index: \"logs\"\n # Enable the S3 DLQ to capture any failed requests in an S3 bucket\n # dlq:\n # s3:\n # Provide an S3 bucket\n # bucket: \"your-dlq-bucket-name\"\n # Provide a key path prefix for the failed requests\n # key_path_prefix: \"${pipelineName}/logs/dlq\"\n # Provide the region of the bucket.\n # region: \"us-east-1\"\n # Provide a Role ARN with access to the bucket. This role should have a trust relationship with osis-pipelines.amazonaws.com\n # sts_role_arn: \"arn:aws:iam::123456789012:role/Example-Role\"\n", "BlueprintName":"AWS-ApacheLogPipeline" } }

要使用 OpenSearch Ingestion API 获取有关管道蓝图的信息,请使用 ListPipelineBlueprintsGetPipelineBlueprint 操作。