From bda05103bc4e5325d4a9254ef016d8f218a4fafd Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Wed, 18 Mar 2020 13:18:56 -0400 Subject: [PATCH] sync logcli.md with command output --- docs/getting-started/logcli.md | 103 ++++++++++++--------------------- 1 file changed, 37 insertions(+), 66 deletions(-) diff --git a/docs/getting-started/logcli.md b/docs/getting-started/logcli.md index b6530ba78d16..545a4d38a03d 100644 --- a/docs/getting-started/logcli.md +++ b/docs/getting-started/logcli.md @@ -94,7 +94,9 @@ Flags: LOKI_CLIENT_CERT_PATH env var. --key="" Path to the client certificate key. Can also be set using LOKI_CLIENT_KEY_PATH env var. - --org-id=ORG-ID org ID header to be substituted for auth + --org-id=ORG-ID adds X-Scope-OrgID to API requests for representing + tenant ID. Useful for requesting tenant data when + bypassing an auth gateway. Commands: help [...] @@ -103,13 +105,19 @@ Commands: query [] Run a LogQL query. - The "query" command is useful for querying for log lines. The default output - of this command are log entries (a combination of timestamp, labels, and a - log line) along with various extra information about the performed query and - its results. Raw log lines (i.e., without a label and timestamp) can be - retrieved by passing the "-o raw" flag. The extra information about the - query (API URL, set of common labels, excluded labels) can be suppressed - with the --query flag. + The "query" command is useful for querying for logs. Logs can be returned in + a few output modes: + + raw: log line + default: log timestamp + log labels + log line + jsonl: JSON response from Loki API of log line + + The output of the log can be specified with the "-o" flag, for example, "-o + raw" for the raw output format. + + The "query" command will output extra information about the query and its + results, such as the API URL, set of common labels, and set of excluded + labels. This extra information can be suppressed with the --quiet flag. While "query" does support metrics queries, its output contains multiple data points between the start and end query time. This output is used to @@ -129,6 +137,11 @@ Commands: This command does not produce useful output when querying for log lines; you should always use the "query" command when you are running log queries. + For more information about log queries and metric queries, refer to the + LogQL documentation: + + https://github.com/grafana/loki/blob/master/docs/logql.md + labels [