

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

# 使用蓝图
<a name="pipeline-blueprint"></a>

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

## 控制台
<a name="pipeline-blueprint-console"></a>

**要使用管道蓝图**

1. [登录 osis/home 的 OpenSearch Ingestion 控制台。https://console.aws.amazon.com/aos/](https://console.aws.amazon.com/aos/osis/home#osis/ingestion-pipelines)您将进入 “管道” 页面。

1. 选择 **Create pipeline（创建管道）**。

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

   初始的管道蓝图是无效的。您需要根据所选择的源指定其他设置。

## CLI
<a name="pipeline-blueprint-cli"></a>

要使用获取所有可用蓝图的列表 AWS CLI，请发送[list-pipeline-blueprints](https://docs.aws.amazon.com/cli/latest/reference/osis/list-pipeline-blueprints.html)请求。

```
aws osis list-pipeline-blueprints 
```

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

要获取有关特定蓝图的更多详细信息，请使用以下[get-pipeline-blueprint](https://docs.aws.amazon.com/cli/latest/reference/osis/get-pipeline-blueprint.html)命令：

```
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 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"
      "BlueprintName":"AWS-ApacheLogPipeline"
   }
}
```

## OpenSearch 摄取 API
<a name="pipeline-blueprint-api"></a>

要使用 OpenSearch Ingestion API 获取有关管道蓝图的信息，请使用和操作。[ListPipelineBlueprints[GetPipelineBlueprint](https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_osis_GetPipelineBlueprint.html)](https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_osis_ListPipelineBlueprints.html)