$ k8scalc compare loki elasticsearch
Loki vs Elasticsearch for Kubernetes Logging
Loki and Elasticsearch are the two most common log backends for Kubernetes. Loki (Grafana Labs) indexes only labels and stores compressed log chunks in object storage, which keeps it cheap and simple. Elasticsearch indexes the full content of every log line, which enables powerful full-text search and analytics at a much higher storage and memory cost.
Last reviewed: 2026-12-01
Verdict
Loki is the right choice for most Kubernetes clusters. It integrates natively with Grafana, uses 5–10× less storage than Elasticsearch (no full-text index on all fields), and has much lower RAM requirements. Elasticsearch wins if you need full-text search across log content, complex aggregations, or already have a centralized ELK stack. For a self-hosted Hetzner cluster where disk cost and RAM are real constraints, Loki with S3 backend (Hetzner Object Storage) is the cost-effective default.
Choose Loki if…
- You use Grafana and want logs next to Prometheus metrics and Tempo traces.
- Storage cost matters: logs go to cheap S3-compatible object storage.
- You mostly search logs by labels (namespace, app, pod) and time range, then filter text.
Choose Elasticsearch if…
- You need fast full-text search across all log content, or complex aggregations.
- You use logs for security analytics or business analytics (Kibana, SIEM).
- You already run an Elastic stack and have the expertise.
Frequently Asked Questions
Is Loki open source?
Yes, under the AGPLv3 licence. It is a Grafana Labs project, not a CNCF project. Elasticsearch is available under several licences, including AGPLv3 since 2024.
How much storage will Loki need?
It depends on ingest volume, compression and retention. The Loki Log Storage Calculator estimates object storage size and cost.
Can Loki do full-text search?
Yes, with filter expressions in LogQL, but it scans the chunks selected by labels rather than using a full-text index. Good label selection keeps queries fast.
Related tool
K8s Cluster Cost
Calculate the monthly cost of running a self-managed Kubernetes cluster on Hetzner Cloud, Vultr, or DigitalOcean. Choose server types for control planes, workers, and load balancers with HA mode.