使用藍圖建立管道 - Amazon OpenSearch Service

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

使用藍圖建立管道

與其從頭開始建立管道定義,您可以使用組態藍圖,這些藍圖是預先設定的 YAML 範本,用於常見的擷取案例,例如 Trace Analytics 或 Apache 日誌。組態藍圖可協助您輕鬆佈建管道,而無需從頭開始撰寫組態。

使用管道藍圖
  1. 登入 Amazon OpenSearch Service 主控台,網址為 https://https://console.aws.amazon.com/aos/home

  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 操作。