diff --git a/docs/reference/commandline/events.md b/docs/reference/commandline/events.md index 56ca19759656..f6bb28d7b03d 100644 --- a/docs/reference/commandline/events.md +++ b/docs/reference/commandline/events.md @@ -165,30 +165,46 @@ The filtering flag (`-f` or `--filter`) format is of "key=value". If you would like to use multiple filters, pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) -Using the same filter multiple times will be handled as a *OR*; for example -`--filter container=588a23dac085 --filter container=a8f7720b8c22` will display -events for container 588a23dac085 *OR* container a8f7720b8c22 +When using multiple filters, filters are handled as an *AND*. The following +example shows container `start` events for a container with **ID** or **name** +`588a23dac085`: -Using multiple filters will be handled as a *AND*; for example -`--filter container=588a23dac085 --filter event=start` will display events for -container container 588a23dac085 *AND* the event type is *start* +```console +$ docker events --filter container=588a23dac085 --filter event=start +```` + +When using the _same_ filter multiple times, those filters are handled as an +*OR*. For example, the following example displays events for container with +**name** (or **ID**) `588a23dac085` *OR* `a8f7720b8c22`: + +```console +$ docker events --filter container=588a23dac085 --filter container=a8f7720b8c22 +``` The currently supported filters are: -* config (`config=`) -* container (`container=`) -* daemon (`daemon=`) -* event (`event=`) -* image (`image=`) -* label (`label=` or `label==`) -* network (`network=`) -* node (`node=`) -* plugin (`plugin=`) -* scope (`scope=`) -* secret (`secret=`) -* service (`service=`) -* type (`type=`) -* volume (`volume=`) +Filter | Example | Description +------------|:-----------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +`type` | `type=` | Only show events for the given object type. Valid values are `config`, `container`, `daemon`, `image`, `network`, `node`, `plugin`, `secret`, `service`, or `volume`. +`event` | `event=` | Only show events with the given event action (e.g. `create`). +`scope` | `scope=` | Only show events in the given scope. Use `local` for local events, and `swarm` for events in the Swarm cluster. +`label` | `label=` or `label==` | Only show events for objects that have a label with the given `label-name` and (optionally) `value`. + +The filters listed below allow you to filter by object reference (object `name`, `name` prefix, `id`, or `id` prefix). + +Filter | Example | Description +------------|:-----------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +`config` | `config=` | Only show events for swarm configs with the given `name` or `id`. +`container` | `container=` | Only show events for containers with the given `name` or `id`. +`daemon` | `daemon=` | Only show events for daemons with the given `name` or `id`. +`image` | `image=` | Only show events for images with the given `repository` or `tag`. +`network` | `network=` | Only show events for swarm configs with the given `name` or `id`. +`node` | `node=` | Only show events for swarm nodes with the given `id`. +`plugin` | `plugin=` | Only show events for plugins with the given `name` or `id`. +`secret` | `secret=` | Only show events for swarm secrets with the given `name` or `id`. +`service` | `service=` | Only show events for swarm services with the given `name` or `id`. +`volume` | `volume=` | Only show events for volumes with the given `name`. + #### Format the output (--format)