
Centralized Logs with Grafana Loki and Promtail
- AuthorBen H.
- Date
- Time13 minutes
Why Loki?
Loki stores logs as compressed chunks indexed by labels. It's cost-effective and integrates with Grafana for queries and dashboards.
Install Promtail
bash
curl -O -L "https://github.com/grafana/loki/releases/download/v2.8.2/promtail-linux-amd64.zip"
unzip promtail-linux-amd64.zip
sudo mv promtail-linux-amd64 /usr/local/bin/promtail
sudo chmod +x /usr/local/bin/promtailMinimal Promtail Config
yaml
server:
http_listen_port: 9080
clients:
- url: http://loki:3100/loki/api/v1/push
scrape_configs:
- job_name: system
static_configs:
- targets: [localhost]
labels:
job: varlogs
__path__: /var/log/*log


