The ELK Stack and What Elasticsearch Is Used For
The bookshop's web servers write thousands of log lines an hour. When checkout breaks at 2 a.m., nobody wants to SSH into five machines and scroll text files. The ELK stack exists to gather those lines in one place, make them searchable, and draw them as charts.
The rule
Collect, store, show: Beats and Logstash collect, Elasticsearch stores, Kibana shows.
ELK is named after three tools from the company Elastic:
- Elasticsearch — the engine that stores the data and answers searches and aggregations.
- Logstash — a processing pipeline. It receives events, reshapes them (parse a raw log line into fields, drop noise, add a location from an IP address) and sends them on.
- Kibana — the web interface. Dashboards, charts, a place to explore data, and the Dev Tools console for sending requests.
A fourth family, Beats (small shippers such as Filebeat for log files and Metricbeat for system metrics), was added later, so you will also hear "the Elastic Stack". Today, Elastic Agent can replace several separate Beats with one managed agent.
A typical flow for the bookshop's logs:
web servers → Filebeat → Logstash (parse, enrich) → Elasticsearch → Kibana dashboardLogs are only one use case. Elasticsearch is hired for:
- Site and app search — the bookshop's search box, with typo tolerance and ranking.
- Logging and observability — logs, metrics and traces from many machines.
- Security analytics — searching events for signs of an attack.
- Analytics on large data — counts, averages and histograms over millions of documents.
- Vector and semantic search — finding items by meaning rather than by exact words.