You can use the --since or --until options with Docker events to narrow down results for the selected timestamp:
--since="" Show all events created since timestamp
--until="" Stream events until this timestamp
Consider the following example:
$ docker events --since '2015-01-01'
With filters, we can further narrow down the events log based on the event, container, and image, as follows:
- To list only the start event, use the following command:
$ docker events --filter 'event=start'
- To list events only from image Alpine, use the following command:
$ docker events --filter 'image=alpine:3.5'
- To list events from a specific container, use the following command:
$ docker events --filter 'container=b3619441cb444b87b4'
With the format option, you can control the output of the event messages:
- To only display some of the event information, you can change the format like this:
$ docker events --format 'ID={{.ID }} Type={{.Type}} Status=
{{.Status}}'
- If you want the events to be streamed as valid JSON lines, then you can use the following command:
$ docker events --format '{{json .}}'