Skip to main content
⎈K8sCalc

$ 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

FeatureLokiElasticsearch
Storage approach
Label index + chunks
Full-text inverted index
Storage cost
Low (5–10× less)
High
RAM per node
~500 MB–2 GB
2–8 GB
Full-text search
No (label-based only)
Yes
Grafana integration
Native
Via plugin
LogQL query language
Yes (LogQL)—
Kibana / ES DSL—
Setup complexity
Low
High (ECK operator)
S3 / object storage backend
Yes (native)
Snapshots only
Log schema requirements
Labels only
Any structured data
CNCF project
No (Grafana Labs, AGPLv3)—
No (Elastic)—

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.

Related Generators

Related Guides