From 0eb79491dd0c689f053f360ab8fc15768e289abc Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Thu, 29 Oct 2015 12:51:36 -0500 Subject: [PATCH] modifying docker --since and --until to support nanoseconds and time zones Signed-off-by: Mike Brown --- docs/reference/commandline/events.md | 16 ++++++++++++---- docs/reference/commandline/logs.md | 17 ++++++++++++----- man/docker-events.1.md | 22 ++++++++++++++++------ man/docker-logs.1.md | 18 +++++++++++++----- 4 files changed, 53 insertions(+), 20 deletions(-) diff --git a/docs/reference/commandline/events.md b/docs/reference/commandline/events.md index d923573096..df88717385 100644 --- a/docs/reference/commandline/events.md +++ b/docs/reference/commandline/events.md @@ -27,10 +27,18 @@ and Docker images will report: delete, import, pull, push, tag, untag -The `--since` and `--until` parameters can be Unix timestamps, RFC3339 -dates or Go duration strings (e.g. `10m`, `1h30m`) computed relative to -client machine’s time. If you do not provide the --since option, the command -returns only new and/or live events. +The `--since` and `--until` parameters can be Unix timestamps, date formated +timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed +relative to the client machine’s time. If you do not provide the --since option, +the command returns only new and/or live events. Supported formats for date +formated time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, +`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local +timezone on the client will be used if you do not provide either a `Z` or a +`+-00:00` timezone offset at the end of the timestamp. When providing Unix +timestamps enter seconds[.nanoseconds], where seconds is the number of seconds +that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap +seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a +fraction of a second no more than nine digits long. ## Filtering diff --git a/docs/reference/commandline/logs.md b/docs/reference/commandline/logs.md index 27d68ead87..601c475bd4 100644 --- a/docs/reference/commandline/logs.md +++ b/docs/reference/commandline/logs.md @@ -31,13 +31,20 @@ the container's `STDOUT` and `STDERR`. Passing a negative number or a non-integer to `--tail` is invalid and the value is set to `all` in that case. -The `docker logs --timestamp` commands will add an [RFC3339Nano timestamp](https://golang.org/pkg/time/#pkg-constants) +The `docker logs --timestamps` command will add an [RFC3339Nano timestamp](https://golang.org/pkg/time/#pkg-constants) , for example `2014-09-16T06:17:46.000000000Z`, to each -log entry. To ensure that the timestamps for are aligned the +log entry. To ensure that the timestamps are aligned the nano-second part of the timestamp will be padded with zero when necessary. The `--since` option shows only the container logs generated after a given date. You can specify the date as an RFC 3339 date, a UNIX -timestamp, or a Go duration string (e.g. `1m30s`, `3h`). Docker computes -the date relative to the client machine’s time. You can combine -the `--since` option with either or both of the `--follow` or `--tail` options. +timestamp, or a Go duration string (e.g. `1m30s`, `3h`). Besides RFC3339 date +format you may also use RFC3339Nano, `2006-01-02T15:04:05`, +`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local +timezone on the client will be used if you do not provide either a `Z` or a +`+-00:00` timezone offset at the end of the timestamp. When providing Unix +timestamps enter seconds[.nanoseconds], where seconds is the number of seconds +that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap +seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a +fraction of a second no more than nine digits long. You can combine the +`--since` option with either or both of the `--follow` or `--tail` options. diff --git a/man/docker-events.1.md b/man/docker-events.1.md index 87d921cdaa..bf0eda92eb 100644 --- a/man/docker-events.1.md +++ b/man/docker-events.1.md @@ -37,10 +37,19 @@ and Docker images will report: **--until**="" Stream events until this timestamp -You can specify `--since` and `--until` parameters as an RFC 3339 date, -a UNIX timestamp, or a Go duration string (e.g. `1m30s`, `3h`). Docker computes -the date relative to the client machine’s time. - +The `--since` and `--until` parameters can be Unix timestamps, date formated +timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed +relative to the client machine’s time. If you do not provide the --since option, +the command returns only new and/or live events. Supported formats for date +formated time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, +`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local +timezone on the client will be used if you do not provide either a `Z` or a +`+-00:00` timezone offset at the end of the timestamp. When providing Unix +timestamps enter seconds[.nanoseconds], where seconds is the number of seconds +that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap +seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a +fraction of a second no more than nine digits long. + # EXAMPLES ## Listening for Docker events @@ -71,8 +80,8 @@ The following example outputs all events that were generated in the last 3 minut relative to the current time on the client machine: # docker events --since '3m' - 2015-05-12T11:51:30.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die - 2015-05-12T15:52:12.999999999Z07:00 4 4386fb97867d: (from ubuntu-1:14.04) stop + 2015-05-12T11:51:30.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die + 2015-05-12T15:52:12.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop 2015-05-12T15:53:45.999999999Z07:00 7805c1d35632: (from redis:2.8) die 2015-05-12T15:54:03.999999999Z07:00 7805c1d35632: (from redis:2.8) stop @@ -84,3 +93,4 @@ April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on docker.com source material and internal work. June 2014, updated by Sven Dowideit June 2015, updated by Brian Goff +October 2015, updated by Mike Brown diff --git a/man/docker-logs.1.md b/man/docker-logs.1.md index b0656f9c50..7374e6cd48 100644 --- a/man/docker-logs.1.md +++ b/man/docker-logs.1.md @@ -42,11 +42,18 @@ logging drivers. **--tail**="*all*" Output the specified number of lines at the end of logs (defaults to all logs) -The `--since` option shows only the container logs generated after -a given date. You can specify the date as an RFC 3339 date, a UNIX -timestamp, or a Go duration string (e.g. `1m30s`, `3h`). Docker computes -the date relative to the client machine’s time. You can combine -the `--since` option with either or both of the `--follow` or `--tail` options. +The `--since` option can be Unix timestamps, date formated timestamps, or Go +duration strings (e.g. `10m`, `1h30m`) computed relative to the client machine’s +time. Supported formats for date formated time stamps include RFC3339Nano, +RFC3339, `2006-01-02T15:04:05`, `2006-01-02T15:04:05.999999999`, +`2006-01-02Z07:00`, and `2006-01-02`. The local timezone on the client will be +used if you do not provide either a `Z` or a `+-00:00` timezone offset at the +end of the timestamp. When providing Unix timestamps enter +seconds[.nanoseconds], where seconds is the number of seconds that have elapsed +since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (aka Unix +epoch or Unix time), and the optional .nanoseconds field is a fraction of a +second no more than nine digits long. You can combine the `--since` option with +either or both of the `--follow` or `--tail` options. # HISTORY April 2014, Originally compiled by William Henry (whenry at redhat dot com) @@ -54,3 +61,4 @@ based on docker.com source material and internal work. June 2014, updated by Sven Dowideit July 2014, updated by Sven Dowideit April 2015, updated by Ahmet Alp Balkan +October 2015, updated by Mike Brown