ELK stack: Elastic search | logstah | kibana
Elastic search:
stores documents in json
builds inverted indexes
supports → full text search | filters | aggregations | vector search
scales horizontally
typical uses → search engines | log search | security analytics | metrics
we interact with ES via RESTful apis
| Relational database | ES |
|---|---|
| Database | Indexes |
| table | patter/types |
| rows | Documents |
| column | fields |
Logstash:
data ingestion and transformation pipeline
collects data from files, kafka, syslogs
parses and transforms regex, json parsin, enrichment
example raw log:
192.168.1.5 - - [27/Jan/2026] "GET /login 401"
after processing with logstash:
{
"ip": "192.168.1.5",
"endpoint": "/login",
"status": 401,
"timestamp": "2026-01-27T10:31:00"
}
now ES can index this properly
Kibana: visualization layer for elastic search
lets you build dashboards, plot time series, create heatmaps, do ad-hoc searches
allows us to interact with elastic search visually
Elastic search applies algorithms such as:
- inverted index
- BM25/TF-IDF
- Fuzzy search
- stemming, lowercasing, stop words, synonyms
- partial matchings via n-grams
- phrase and proximity search
- filters
ES cluster: set of VMs
ES Node: a VM instance
Index: database
ES ID: primary key
all possible Node roles
master node: eligible to be a master role
data node: can perform CRUD operations
ingest node:
….
ES shard: self contained lucene index that holds a subset of your documents
why? 1) one machine cant handle infinite data so to horizontally scale → each query will be sent to all shards in parallel
2) parallelism, search at more shards at once to get results faster then re-rank them in the end to get top k results
mapping in ES: for each ES field, you define a mapping:-
1. type (text, keyword, integer, float, date, boolean
2. indexing behavior (searchable or not, tokenized or not)
3. search behavior (fuzzy, exact, sortable, aggregatable)
each mapping can be either:
- explicit mappping: you define your schema
- dynamic mapping: ES guesses your schema