pcluster get-image-log-events - Amazon ParallelCluster
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

pcluster get-image-log-events

检索与映像构建相关的事件。

pcluster get-image-log-events [-h] --image-id IMAGE_ID --log-stream-name LOG_STREAM_NAME [--debug] [--end-time END_TIME] [--limit LIMIT] [--next-token NEXT_TOKEN] [--query QUERY] [--region REGION] [--start-from-head START_FROM_HEAD] [--start-time START_TIME]

命名参数

-h, --help

显示的帮助文本pcluster get-image-log-events

--image-id, -i IMAGE_ID

指定图像的 ID。

--log-stream-name LOG_STREAM_NAME

指定日志流的名称。你可以使用list-image-log-streams命令来检索与一个或多个事件关联的日志流。

--debug

启用调试日志。

--end-time END_TIME

指定时间范围的结束时间,以 ISO 8601 格式表示 (YYYY-MM-DDThh:mm:ssZ,例如2021-01-01T20:00:00Z)。不包括时间戳等于或晚于该时间的事件。

--limit LIMIT

指定返回的最大日志事件数。如果未指定值,则最大值为 1 MB 的响应大小所能容纳的日志事件,最多 10,000 个日志事件。

--next-token NEXT_TOKEN

指定用于分页请求的令牌。

--query QUERY

指定要对输出执行的 JMESPath 查询。

--region, -r REGION

指定Amazon Web Services 区域要使用。的Amazon Web Services 区域必须指定,使用AWS_DEFAULT_REGION环境变量,region设置在[default]的部分~/.aws/config文件,或--region参数。

--start-from-head START_FROM_HEAD

如果值为true,则首先返回最早的日志事件。如果值为false,则首先返回最新的日志事件。(默认为false。)

--start-time START_TIME

指定以 ISO 8601 格式表示的时间范围的起点 (YYYY-MM-DDThh:mm:ssZ,例如2021-01-01T20:00:00Z)。包括时间戳等于或晚于该时间的事件。

使用示例Amazon ParallelCluster版本 3.1.2:

$ pcluster get-image-log-events --image-id custom-alinux2-image --region us-east-1 --log-stream-name 3.1.2/1 --limit 3 { "nextToken": "f/36778317771100849897800729464621464113270312017760944178/s", "prevToken": "b/36778317766952911290874033560295820514557716777648586800/s", "events": [ { "message": "ExecuteBash: FINISHED EXECUTION", "timestamp": "2022-04-05T22:13:26.633Z" }, { "message": "Document arn:aws:imagebuilder:us-east-1:123456789012:component/parallelclusterimage-test-1234abcd-56ef-78gh-90ij-abcd1234efgh/3.1.2/1", "timestamp": "2022-04-05T22:13:26.741Z" }, { "message": "TOE has completed execution successfully", "timestamp": "2022-04-05T22:13:26.819Z" } ] }