logcli query
logcli query [--quiet] '<LogQL>'
Risk: Safe
What it does
Asks Loki a LogQL question from the terminal and prints the matching diary lines.
When to use it
Searching logs without a browser, or in a script.
Example
$ logcli query --quiet '{app="kedai-api"} |= "timeout"'Show kedai-api's lines that mention timeout.
$ logcli labelsWhich labels does Loki know?
$ logcli labels appWhich values does the app label have?
$ logcli query --quiet '{app=~"kedai-.*"} |= "<trace-id>"'Follow one order across every kedai diary.
Learn it in: Loki and LogQL basics · Official docs