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

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

pcluster get-cluster-log-events

检索与日志流关联的事件。

pcluster get-cluster-log-events [-h] --cluster-name CLUSTER_NAME --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-cluster-log-events 的帮助文本。

--cluster-name, -n CLUSTER_NAME

指定集群的名称。

--log-stream-name LOG_STREAM_NAME

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

--debug

启用调试日志记录。

--end-time END_TIME

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

--limit LIMIT

指定返回的日志事件的最大数量。如果不指定值,则最大值为 1 MB 的响应大小所能容纳的日志事件数量,最多可达 10000 个日志事件。

--next-token NEXT_TOKEN

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

--query QUERY

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

--region, -r REGION

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

--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.4 的示例:

$ pcluster get-cluster-log-events \ -c cluster-v3 \ -r us-east-1 \ --log-stream-name ip-198-51-100-44.i-1234567890abcdef0.clustermgtd \ --limit 3 { "nextToken": "f/36966906399261933213029082268132291405859205452101451780/s", "prevToken": "b/36966906399239632467830551644990755687586557090595471362/s", "events": [ { "message": "2022-07-12 19:16:53,379 - [slurm_plugin.clustermgtd:_maintain_nodes] - INFO - Performing node maintenance actions", "timestamp": "2022-07-12T19:16:53.379Z" }, { "message": "2022-07-12 19:16:53,380 - [slurm_plugin.clustermgtd:_maintain_nodes] - INFO - Following nodes are currently in replacement: (x0) []", "timestamp": "2022-07-12T19:16:53.380Z" }, { "message": "2022-07-12 19:16:53,380 - [slurm_plugin.clustermgtd:_terminate_orphaned_instances] - INFO - Checking for orphaned instance", "timestamp": "2022-07-12T19:16:53.380Z" } ] }