From 7165c41a86a1f31befdff7671f6652313f9219f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Socho=C5=84?= Date: Thu, 21 Jan 2021 20:11:03 +0100 Subject: [PATCH 1/2] Update docs for logcli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix description for logcli, use proper flag names. Extend docs with example using timestamp. Signed-off-by: Michał Sochoń --- cmd/logcli/main.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/cmd/logcli/main.go b/cmd/logcli/main.go index 10d53c9580a4..a38398a75be6 100644 --- a/cmd/logcli/main.go +++ b/cmd/logcli/main.go @@ -48,7 +48,21 @@ of excluded labels. This extra information can be suppressed with the --quiet flag. By default we look over the last hour of data; use --since to modify -or provide specific start and end times with --start and --end. +or provide specific start and end times with --from and --to respectively. + +Notice that when using --from and --to then ensure to use RFC3339Nano +time format, but without timezone at the end. The local timezone will be added +automatically or if using --timezone flag. + +Example: + + logcli query + --timezone=UTC + --from="2021-01-19T10:00:00.000000000Z" + --to="2021-01-19T20:00:00.000000000Z" + --output=jsonl + 'my-query' + The output is limited to 30 entries by default; use --limit to increase. While "query" does support metrics queries, its output contains multiple From aa6a3546ef0a3cccf80ee2ad4a53e47a690f9924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Socho=C5=84?= Date: Fri, 22 Jan 2021 19:40:39 +0100 Subject: [PATCH 2/2] Update cmd/logcli/main.go Co-authored-by: Owen Diehl --- cmd/logcli/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/logcli/main.go b/cmd/logcli/main.go index a38398a75be6..17c882bcdd0d 100644 --- a/cmd/logcli/main.go +++ b/cmd/logcli/main.go @@ -58,8 +58,8 @@ Example: logcli query --timezone=UTC - --from="2021-01-19T10:00:00.000000000Z" - --to="2021-01-19T20:00:00.000000000Z" + --from="2021-01-19T10:00:00Z" + --to="2021-01-19T20:00:00Z" --output=jsonl 'my-query'