NAME¶ 名称
podman-events - Monitor Podman events
podman-events - 监控 Podman 事件
SYNOPSIS¶ 概要
podman events [options] podman 事件 [选项]
podman system events [options]
podman 系统事件 [选项]
DESCRIPTION¶ 描述
Monitor and print events that occur in Podman. Each event includes a timestamp,
a type, a status, name (if applicable), and image (if applicable). The default logging
mechanism is journald. This can be changed in containers.conf by changing the events_logger
value to file
. Only file
and journald
are accepted. A none
logger is also
available, but this logging mechanism completely disables events; nothing is reported by
podman events
.
监视并打印发生在 Podman 中的事件。每个事件包括时间戳、类型、状态、名称(如果适用)和镜像(如果适用)。默认的日志记录机制是 journald。可以通过在 containers.conf 中将 events_logger
值更改为 file
来更改此设置。仅接受 file
和 journald
。还提供了一个 none
记录器,但此日志记录机制会完全禁用事件; podman events
不会报告任何内容。
By default, streaming mode is used, printing new events as they occur. Previous events can be listed via --since
and --until
.
默认情况下,使用流模式,打印新事件的发生情况。可以通过 --since
和 --until
列出先前的事件。
The container event type reports the follow statuses:
容器事件类型报告以下状态:
attach 附加
checkpoint 检查点
cleanup 清理
commit 提交
connect 连接
create 创建
died 死亡
disconnect 断开连接
exec 执行
exec_died 进程终止
exited 退出
export 导出
import 导入
init 初始化
kill 终止
mount 安装
pause 暂停
prune 精简
remove 删除
rename 重命名
restart 重新启动
restore 恢复
start 开始
stop 停止
sync 同步
unmount 卸载
unpause 取消暂停
update 更新
The pod event type reports the follow statuses:
Pod 事件类型报告以下状态:
create 创建
kill 终止
pause 暂停
remove 删除
start 开始
stop 停止
unpause 恢复
The image event type reports the following statuses:
图像事件类型报告以下状态:
loadFromArchive, 从存档加载
mount 安装
pull 拉取
pull-error 拉取错误
push 推送
remove 移除
save 保存
tag
unmount 卸载
untag 取消标记
The system type reports the following statuses:
系统类型报告以下状态:
refresh 刷新
renumber 重新编号
The volume type reports the following statuses:
卷类型报告以下状态:
create 创建
prune 精简
remove 删除
Verbose Create Events¶ 冗长创建事件 ¶
Setting events_container_create_inspect_data=true
in containers.conf(5) instructs Podman to create more verbose container-create events which include a JSON payload with detailed information about the containers. The JSON payload is identical to the one of podman-container-inspect(1). The associated field in journald is named PODMAN_CONTAINER_INSPECT_DATA
.
在 containers.conf(5) 中设置 events_container_create_inspect_data=true
会指示 Podman 创建更冗长的容器创建事件,其中包括一个包含有关容器详细信息的 JSON 负载。JSON 负载与 podman-container-inspect(1) 的负载相同。journald 中的关联字段名为 PODMAN_CONTAINER_INSPECT_DATA
。
OPTIONS¶ 选项
--filter, -f=filter¶ --filter, -f=过滤器 ¶
Filter events that are displayed. They must be in the format of “filter=value”. The following
filters are supported:
过滤要显示的事件。它们必须采用“filter=value”的格式。支持以下过滤器:
Filter |
Description |
---|---|
container |
[Name or ID] Container’s name or ID |
event |
event_status (described above) |
image |
[Name or ID] Image name or ID |
label |
[key=value] label [键=值] 标签 |
pod |
[Name or ID] Pod name or ID |
volume |
[Name or ID] Volume name or ID |
type |
Event_type (described above) |
In the case where an ID is used, the ID may be in its full or shortened form. The “die” event is mapped to “died” for Docker compatibility.
在使用 ID 的情况下,ID 可以是完整的形式或缩写形式。为了 Docker 的兼容性,“die” 事件被映射为 “died”。
--format¶
Format the output to JSON Lines or using the given Go template.
将输出格式化为 JSON Lines 或使用给定的 Go 模板。
Placeholder |
Description |
---|---|
.Attributes … |
created_at, _by, labels, and more (map[]) |
.ContainerExitCode |
Exit code (int) 退出代码 (int) |
.ContainerInspectData |
Payload of the container’s inspect |
.Error |
Error message in case the event status is an error (e.g. pull-error) |
.HealthStatus |
Health Status (string) 健康状态(字符串) |
.ID |
Container ID (full 64-bit SHA) |
.Image |
Name of image being run (string) |
.Name |
Container name (string) 容器名称(字符串) |
.Network |
Name of network being used (string) |
.PodID |
ID of pod associated with container, if any |
.Status |
Event status (e.g., create, start, died, …) |
.Time |
Event timestamp (string) 事件时间戳(字符串) |
.TimeNano |
Event timestamp with nanosecond precision (int64) |
.Type |
Event type (e.g., image, container, pod, …) |
--help¶ --帮助 ¶
Print usage statement. 打印使用说明。
--no-trunc¶
Do not truncate the output (default true).
不要截断输出(默认为 true)。
--since=timestamp¶
Show all events created since the given timestamp
显示自给定时间戳以来创建的所有事件
--stream¶ --流 ¶
Stream events and do not exit after reading the last known event (default true).
流式事件,并在读取最后一个已知事件后不退出(默认为 true)。
--until=timestamp¶ --直到=时间戳 ¶
Show all events created until the given timestamp
显示直到给定时间戳创建的所有事件
The since and until values can be RFC3339Nano time stamps or a Go duration string such as 10m, 5h. If no
since or until values are provided, only new events are shown.
since 和 until 值可以是 RFC3339Nano 时间戳或 Go duration 字符串,例如 10m,5h。如果没有提供 since 或 until 值,则只显示新事件。
JOURNALD IDENTIFIERS¶ JOURNALD 标识符
The journald events-backend of Podman uses the following journald identifiers. You can use the identifiers to filter Podman events directly with journalctl
.
Podman 的 journald 事件后端使用以下 journald 标识符。您可以使用这些标识符直接过滤 Podman 事件 journalctl
。
Identifier |
Description |
---|---|
SYSLOG_IDENTIFIER |
Always set to “podman” 始终设置为“podman” |
PODMAN_EVENT |
The event status as described above |
PODMAN_TYPE |
The event type as described above |
PODMAN_TIME |
The time stamp when the event was written |
PODMAN_NAME |
Name of the event object (e.g., container, image) |
PODMAN_ID |
ID of the event object (e.g., container, image) |
PODMAN_EXIT_CODE |
Exit code of the container |
PODMAN_POD_ID |
Pod ID of the container |
PODMAN_LABELS |
Labels of the container 容器的标签 |
PODMAN_HEALTH_STATUS |
Health status of the container |
PODMAN_CONTAINER_INSPECT_DATA |
The JSON payload of |
PODMAN_NETWORK_NAME |
The name of the network |
EXAMPLES¶ 示例
Show Podman events: 显示 Podman 事件:
$ podman events
2019-03-02 10:33:42.312377447 -0600 CST container create 34503c192940 (image=docker.io/library/alpine:latest, name=friendly_allen)
2019-03-02 10:33:46.958768077 -0600 CST container init 34503c192940 (image=docker.io/library/alpine:latest, name=friendly_allen)
2019-03-02 10:33:46.973661968 -0600 CST container start 34503c192940 (image=docker.io/library/alpine:latest, name=friendly_allen)
2019-03-02 10:33:50.833761479 -0600 CST container stop 34503c192940 (image=docker.io/library/alpine:latest, name=friendly_allen)
2019-03-02 10:33:51.047104966 -0600 CST container cleanup 34503c192940 (image=docker.io/library/alpine:latest, name=friendly_allen)
Show only Podman container create events:
仅显示 Podman 容器创建事件:
$ podman events -f event=create
2019-03-02 10:36:01.375685062 -0600 CST container create 20dc581f6fbf (image=docker.io/library/alpine:latest, name=sharp_morse)
2019-03-02 10:36:08.561188337 -0600 CST container create 58e7e002344c (image=registry.k8s.io/pause:3.1, name=3e701f270d54-infra)
2019-03-02 10:36:13.146899437 -0600 CST volume create cad6dc50e087 (image=, name=cad6dc50e0879568e7d656bd004bd343d6035e7fc4024e1711506fe2fd459e6f)
2019-03-02 10:36:29.978806894 -0600 CST container create d81e30f1310f (image=docker.io/library/busybox:latest, name=musing_newton)
Show only Podman pod create events:
仅显示 Podman pod 创建事件:
$ podman events --filter event=create --filter type=pod
2019-03-02 10:44:29.601746633 -0600 CST pod create 1df5ebca7b44 (image=, name=confident_hawking)
2019-03-02 10:44:42.374637304 -0600 CST pod create ca731231718e (image=, name=webapp)
2019-03-02 10:44:47.486759133 -0600 CST pod create 71e807fc3a8e (image=, name=reverent_swanson)
Show only Podman events created in the last five minutes:
仅显示过去五分钟内创建的 Podman 事件:
$ sudo podman events --since 5m
2019-03-02 10:44:29.598835409 -0600 CST container create b629d10d3831 (image=registry.k8s.io/pause:3.1, name=1df5ebca7b44-infra)
2019-03-02 10:44:29.601746633 -0600 CST pod create 1df5ebca7b44 (image=, name=confident_hawking)
2019-03-02 10:44:42.371100253 -0600 CST container create 170a0f457d00 (image=registry.k8s.io/pause:3.1, name=ca731231718e-infra)
2019-03-02 10:44:42.374637304 -0600 CST pod create ca731231718e (image=, name=webapp)
Show Podman events in JSON Lines format:
以 JSON Lines 格式显示 Podman 事件:
$ podman events --format json
{"ID":"683b0909d556a9c02fa8cd2b61c3531a965db42158627622d1a67b391964d519","Image":"localhost/myshdemo:latest","Name":"agitated_diffie","Status":"cleanup","Time":"2019-04-27T22:47:00.849932843-04:00","Type":"container"}
{"ID":"a0f8ab051bfd43f9c5141a8a2502139707e4b38d98ac0872e57c5315381e88ad","Image":"docker.io/library/alpine:latest","Name":"friendly_tereshkova","Status":"unmount","Time":"2019-04-28T13:43:38.063017276-04:00","Type":"container"}
SEE ALSO¶ 参见 ¶
HISTORY¶ 历史 ¶
March 2019, Originally compiled by Brent Baude bbaude@redhat.com
2019 年 3 月,最初由 Brent Baude bbaude@redhat.com 编译