1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00
Files
openshift-docs/modules/cluster-logging-logcli-reference.adoc
2024-09-17 12:27:15 -04:00

32 lines
1013 B
Plaintext

// Module is included in the following assemblies:
//cluster-logging-loki.adoc
:_mod-docs-content-type: REFERENCE
[id="logging-logcli-about_{context}"]
= Querying Loki
You can use Loki's command-line interface `logcli` to query logs.
.Example Application Log Query
[source,terminal]
----
$ oc extract cm/lokistack-sample-ca-bundle --to=lokistack --confirm
$ cat lokistack/*.crt >lokistack_ca.crt
$ logcli -o raw --bearer-token="${bearer_token}" --ca-cert="lokistack_ca.crt" --addr xxxxxx
----
.Example Infrastructure Log Query
[source,terminal]
----
$ logcli --bearer-token="$(oc whoami -t)" --addr https://lokistack-dev-openshift-logging.apps.devcluster.openshift.com/api/logs/v1/infrastructure labels
----
.Example Audit log Query
[source,terminal]
----
$ logcli --bearer-token="$(oc whoami -t)" --addr https://lokistack-dev-openshift-logging.apps.devcluster.openshift.com/api/logs/v1/audit labels
----
.Additional resources
* link:https://grafana.com/docs/loki/latest/tools/logcli/[LogCLI Documentation]