Loki versus Elasticsearch/OpenSearch for logs: what are the trade-offs?
IntermediateProductionLog Pipelines
Answer
- Loki: label index plus compressed chunks in object storage. Much cheaper to run and store, simple operations, but full-text search across huge ranges is brute force (scans chunks).
- Elasticsearch/OpenSearch: full inverted index, fast arbitrary search and rich aggregations, but expensive in CPU, RAM and disk, and heavier to operate (shards, mappings, JVM).
We use Loki for most application logs and an indexed store (or SIEM) for security and search-heavy use cases.
More on Log Pipelines
What does a production log pipeline look like end to end?BeginnerWhy structured (JSON) logging, and what fields should every log line have?BeginnerFluent Bit, Vector, Grafana Alloy or the OpenTelemetry Collector: how do you choose a log agent?IntermediateWhy add an aggregation tier instead of sending directly from agents to the backend?IntermediateHow do you design log retention tiers?IntermediateHow do you scrub PII from logs in the pipeline?Intermediate