Getting started¶
Install¶
Grab the appropriate artifact from the latest
release and drop it
on your $PATH:
loki-cli-linux-x86_64loki-cli-windows-x86_64.exe
See Building binaries if you want to build locally.
See Docker & Kubernetes.
First login¶
loki-cli login --url https://loki.example.com
# → Verifies the endpoint and saves the profile as `default`.
Or use a token:
Explore¶
loki-cli labels # what labels does the server carry?
loki-cli target --count # what hosts / sources are shipping logs?
loki-cli logs my-host --since 15m
loki-cli logs my-host -f # live tail
Multiple environments¶
loki-cli config set --profile prod --url https://loki.prod.example.com --token "$T_PROD"
loki-cli config set --profile dev --url https://loki.dev.example.com --token "$T_DEV"
loki-cli config use prod
loki-cli --profile dev target --count # one-off against dev
Continue with Profiles & env vars for the full precedence rules.