promtail(1)
Promtail is a log collector agent that ships logs to Loki for storage and querying.
Synopsis
promtail [flags]Description
Promtail is a agent which reads logs from files, systemd journal, syslog, and other sources, then pushes them to Loki. It discovers targets and tails logs, extracting labels from log paths and content for structured indexing. Promtail runs as a daemon and is typically deployed on each machine that generates logs.
Configuration is managed via a YAML file that specifies scrape configs (which logs to collect), relabel rules for label extraction, and target discovery mechanisms. Promtail then authenticates to a Loki instance and streams the logs with their associated labels.
Common options
| Flag | What it does |
|---|---|
-config.file | Path to the Promtail configuration file (default: promtail-local-config.yaml) |
-config.expand-env | Expand environment variables in config file |
-log.level | Log level (debug, info, warn, error; default: info) |
-log.format | Log output format (logfmt or json; default: logfmt) |
-server.http.listen-address | HTTP server listen address (default: 0.0.0.0:3100) |
-server.grpc.listen-address | gRPC server listen address (default: 0.0.0.0:9096) |
-print-config-stderr | Print configuration to stderr at startup |
-version | Show version and exit |
Examples
Start Promtail with the specified configuration file to begin collecting logs
promtail -config.file=/etc/promtail/config.yamlStart Promtail in debug mode for verbose logging to troubleshoot issues
promtail -config.file=/etc/promtail/config.yaml -log.level=debugRun Promtail listening only on localhost for development or testing
promtail -config.file=config.yaml -server.http.listen-address=localhost:3100Start Promtail and expand environment variables in the configuration file
promtail -config.file=/etc/promtail/config.yaml -config.expand-envDisplay the parsed configuration to stderr to verify correct loading
promtail -print-config-stderr -config.file=config.yaml