

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

# 檢視 Amazon OpenSearch 擷取管道
<a name="list-pipeline"></a>

您可以使用 AWS 管理主控台、 AWS CLI或 OpenSearch Ingestion API 檢視 Amazon OpenSearch Ingestion 管道的詳細資訊。

## 主控台
<a name="list-pipeline-console"></a>

**檢視管道**

1. 登入 Amazon OpenSearch Service 主控台，網址為 https：//[https://console.aws.amazon.com/aos/osis/home](https://console.aws.amazon.com/aos/osis/home#osis/ingestion-pipelines)。您將進入管道頁面。

1. （選用） 若要檢視具有特定狀態的管道，請選擇**任何狀態**，然後選取要篩選的狀態。

   管道可以有下列狀態：
   + `Active` – 管道處於作用中狀態，並準備好擷取資料。
   + `Creating` – 正在建立管道。
   + `Updating` – 管道正在更新。
   + `Deleting` – 正在刪除管道。
   + `Create failed` – 無法建立管道。
   + `Update failed` – 無法更新管道。
   + `Stop failed` – 管道無法停止。
   + `Start failed` – 無法啟動管道。
   + `Stopping` – 管道正在停止。
   + `Stopped` – 管道已停止，可隨時重新啟動。
   + `Starting` – 管道正在啟動。

當管道處於 `Create failed`、`Deleting`、 和 `Stopped` 狀態時`Creating`，您不需要支付擷取 OCUs 的費用。

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

若要使用 檢視管道 AWS CLI，請傳送[清單管道](https://docs.aws.amazon.com/cli/latest/reference/osis/list-pipelines.html)請求：

```
aws osis list-pipelines  
```

請求會傳回所有現有管道的清單：

```
{
    "NextToken": null,
    "Pipelines": [
        {,
            "CreatedAt": 1.671055851E9,
            "LastUpdatedAt": 1.671055851E9,
            "MaxUnits": 4,
            "MinUnits": 2,
            "PipelineArn": "arn:aws:osis:us-west-2:123456789012:pipeline/log-pipeline",
            "PipelineName": "log-pipeline",
            "Status": "ACTIVE",
            "StatusReason": {
                "Description": "The pipeline is ready to ingest data."
            }
        },
            "CreatedAt": 1.671055851E9,
            "LastUpdatedAt": 1.671055851E9,
            "MaxUnits": 2,
            "MinUnits": 8,
            "PipelineArn": "arn:aws:osis:us-west-2:123456789012:pipeline/another-pipeline",
            "PipelineName": "another-pipeline",
            "Status": "CREATING",
            "StatusReason": {
                "Description": "The pipeline is being created. It is not able to ingest data."
            }
        }
    ]
}
```

若要取得單一管道的相關資訊，請使用 [get-pipeline](https://docs.aws.amazon.com/cli/latest/reference/osis/get-pipeline.html) 命令：

```
aws osis get-pipeline --pipeline-name "my-pipeline"
```

請求會傳回指定管道的組態資訊：

```
{
    "Pipeline": {
        "PipelineName": "my-pipeline",
        "PipelineArn": "arn:aws:osis:us-east-1:123456789012:pipeline/my-pipeline",
        "MinUnits": 9,
        "MaxUnits": 10,
        "Status": "ACTIVE",
        "StatusReason": {
            "Description": "The pipeline is ready to ingest data."
        },
        "PipelineConfigurationBody": "log-pipeline:\n source:\n http:\n processor:\n - grok:\n match:\nlog: [ '%{COMMONAPACHELOG}' ]\n - date:\n from_time_received: true\n destination: \"@timestamp\"\n  sink:\n - opensearch:\n hosts: [ \"https://search-mdp-performance-test-duxkb4qnycd63rpy6svmvyvfpi.us-east-1.es.amazonaws.com\" ]\n index: \"apache_logs\"\n aws_sts_role_arn: \"arn:aws:iam::123456789012:role/my-domain-role\"\n  aws_region: \"us-east-1\"\n  aws_sigv4: true",,
        "CreatedAt": "2022-10-01T15:28:05+00:00",
        "LastUpdatedAt": "2022-10-21T21:41:08+00:00",
        "IngestEndpointUrls": [
            "my-pipeline-123456789012.us-east-1.osis.amazonaws.com"
        ]
    }
}
```

## OpenSearch 擷取 API
<a name="list-pipelines-api"></a>

若要使用 OpenSearch Ingestion API 檢視 OpenSearch Ingestion 管道，請呼叫 [ListPipelines](https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_osis_ListPipelines.html) 和 [GetPipeline](https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_osis_GetPipeline.html) 操作。