Belajar Sendiri

Commands

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 labels

Which labels does Loki know?

$ logcli labels app

Which values does the app label have?

$ logcli query --quiet '{app=~"kedai-.*"} |= "<trace-id>"'

Follow one order across every kedai diary.