From 459e4e3f4eb45be27262ac44133f7768340489ae Mon Sep 17 00:00:00 2001 From: Sandeep Sukhani Date: Tue, 30 Jul 2019 17:41:14 +0530 Subject: [PATCH] Update logcli usage in docs and improve help text --- cmd/logcli/main.go | 2 +- docs/logcli.md | 58 ++++++++++++++++++++++++++++------------------ 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/cmd/logcli/main.go b/cmd/logcli/main.go index 1e3ca247be..38ce7791f7 100644 --- a/cmd/logcli/main.go +++ b/cmd/logcli/main.go @@ -31,7 +31,7 @@ var ( to = queryCmd.Flag("to", "Stop looking for logs at this absolute time (exclusive)").String() forward = queryCmd.Flag("forward", "Scan forwards through logs.").Default("false").Bool() tail = queryCmd.Flag("tail", "Tail the logs").Short('t').Default("false").Bool() - delayFor = queryCmd.Flag("delay-for", "Delay in tailing by number of seconds to accumulate logs").Default("0").Int() + delayFor = queryCmd.Flag("delay-for", "Delay in tailing by number of seconds to accumulate logs for re-ordering").Default("0").Int() noLabels = queryCmd.Flag("no-labels", "Do not print any labels").Default("false").Bool() ignoreLabelsKey = queryCmd.Flag("exclude-label", "Exclude labels given the provided key during output.").Strings() showLabelsKey = queryCmd.Flag("include-label", "Include labels given the provided key during output.").Strings() diff --git a/docs/logcli.md b/docs/logcli.md index 21bcc340a5..116d3475ee 100644 --- a/docs/logcli.md +++ b/docs/logcli.md @@ -60,15 +60,17 @@ usage: logcli [] [ ...] A command-line for loki. Flags: - --help Show context-sensitive help (also try --help-long and --help-man). - --addr="https://logs-us-west1.grafana.net" - Server address. - --username="" Username for HTTP basic auth. - --password="" Password for HTTP basic auth. - --ca-cert="" Path to the server Certificate Authority. - --tls-skip-verify Server certificate TLS skip verify. - --cert="" Path to the client certificate. - --key="" Path to the client certificate key. + --help Show context-sensitive help (also try --help-long and --help-man). + -q, --quiet suppress everything but log lines + -o, --output=default specify output mode [default, raw, jsonl] + --addr="https://logs-us-west1.grafana.net" + Server address. + --username="" Username for HTTP basic auth. + --password="" Password for HTTP basic auth. + --ca-cert="" Path to the server Certificate Authority. + --tls-skip-verify Server certificate TLS skip verify. + --cert="" Path to the client certificate. + --key="" Path to the client certificate key. Commands: help [...] @@ -86,20 +88,30 @@ usage: logcli query [] [] Run a LogQL query. Flags: - --help Show context-sensitive help (also try --help-long and --help-man). - --addr="" Server address, need to specify. - --username="" Username for HTTP basic auth. - --password="" Password for HTTP basic auth. - --limit=30 Limit on number of entries to print. - --since=1h Lookback window. - --forward Scan forwards through logs. - -t, --tail Tail the logs - --no-labels Do not print any labels - --exclude-label=EXCLUDE-LABEL ... - Exclude labels given the provided key during output. - --include-label=INCLUDE-LABEL ... - Include labels given the provided key during output. - --labels-length=0 Set a fixed padding to labels + --help Show context-sensitive help (also try --help-long and --help-man). + -q, --quiet suppress everything but log lines + -o, --output=default specify output mode [default, raw, jsonl] + --addr="https://logs-us-west1.grafana.net" + Server address. + --username="" Username for HTTP basic auth. + --password="" Password for HTTP basic auth. + --ca-cert="" Path to the server Certificate Authority. + --tls-skip-verify Server certificate TLS skip verify. + --cert="" Path to the client certificate. + --key="" Path to the client certificate key. + --limit=30 Limit on number of entries to print. + --since=1h Lookback window. + --from=FROM Start looking for logs at this absolute time (inclusive) + --to=TO Stop looking for logs at this absolute time (exclusive) + --forward Scan forwards through logs. + -t, --tail Tail the logs + --delay-for=0 Delay in tailing by number of seconds to accumulate logs for re-ordering + --no-labels Do not print any labels + --exclude-label=EXCLUDE-LABEL ... + Exclude labels given the provided key during output. + --include-label=INCLUDE-LABEL ... + Include labels given the provided key during output. + --labels-length=0 Set a fixed padding to labels Args: eg '{foo="bar",baz="blip"}'