Pcornel
Observability · Log Platforms

Elasticsearch and OpenSearch Log Indices

Cheat sheet · https://pcornel.dk/topic.php?topic=6222

Back to the Topic

Answer

Elasticsearch/OpenSearch store logs in indices (often time-based or data streams) split into shards, with mappings for field types and ILM/ISM policies for rollover and deletion.

Remember

Cluster health yellow/red means unassigned shards. Keep shard sizes reasonable (tens of GB). Explicit mappings avoid mapping explosions. Lifecycle policies delete old data.

First checks

  • curl -s es:9200/_cluster/health?pretty — first check for this topic
  • curl -s localhost:9090/-/ready — Prometheus ready
  • curl -s 'localhost:9090/api/v1/query?query=up' — scrape targets up/down
  • promtool check config prometheus.yml — config valid

Verify in this order

log → ingest pipeline → index/data stream → shards → lifecycle

Where it usually breaks

Too many small shards waste memory.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6222

Confirmation

Confirm action

Continue?