← Back to cheat sheets

Monitoring & Observability

ELK cheat sheet

ELK centralizes logs for debugging and operations.

On this page

Table of contents

Use this page for fast recall. Use Full documentation when you want the complete end-to-end path.

Quick workflow

A simple 5-step flow you can follow when using ELK in real work.

1) Setup

Install/run the tool and confirm version. Create a minimal config.

2) Small change

Do one small action end-to-end to prove the workflow.

3) Validate

Check output, logs, and status. Catch mistakes early.

4) Automate

Convert it into a repeatable script or pipeline step.

5) Productionize

Add safety: secrets, rollback, observability, and docs.

Workflows you will actually reuse

These are practical sequences you can copy into your own checklist or runbook.

Log ingestion to dashboard

Goal: Get from raw logs to searchable, actionable views.

- Ship logs (Filebeat/agent) to pipeline (Logstash or ingest).

- Normalize fields (service, env, level, requestId).

- Index into Elasticsearch with sane mappings.

- Create Kibana searches and dashboards for common incidents.

- Tune retention and index lifecycle to control costs.

Key Concepts

- Ingestion

- Indexing

- Visualization

Learning path (high-level):

- Log pipeline setup

- Query patterns

- Ops dashboards

Quick Start

Send logs to pipeline

Index in Elasticsearch

Search in Kibana

Common Commands

Short descriptions and practical intent. Search, filter, copy, and reuse.

Showing 9

Elasticsearch
curl localhost:9200

Check Elasticsearch endpoint.

Elasticsearch
curl localhost:9200/_cluster/health?pretty

Cluster health summary.

Elasticsearch
curl localhost:9200/_cat/nodes?v

List cluster nodes.

Elasticsearch
curl localhost:9200/_cat/indices?v

List indices.

Elasticsearch
curl localhost:9200/<index>/_search?q=error

Search error logs quickly.

Kibana
curl localhost:5601/api/status

Check Kibana status.

Logstash
bin/logstash -f pipeline.conf

Run Logstash with config file.

Beats
filebeat test output

Validate Filebeat output connectivity.

Beats
filebeat test config

Validate Filebeat config.

Copyable snippets

Small blocks you can drop into your terminal, config, or runbook.

Quick index search

bash

curl -s 'http://localhost:9200/my-index/_search?q=level:ERROR&size=5' | jq .hits.hits[].'_source'

Troubleshooting checklist

When things break, follow this order to stay calm and move fast.

- If ingestion fails: verify output connectivity and auth (Filebeat test output).

- If searches are slow: reduce wildcard queries and improve mappings.

- If storage grows: check retention, ILM policies, and shard counts.

Pitfalls

The common mistakes that slow people down when using ELK.

- Copy-pasting commands without understanding inputs/outputs and side effects.

- Not documenting defaults (ports, paths, credentials) and then getting stuck in prod.

- Skipping logs and metrics when troubleshooting; always collect evidence first.

Mini lab (practice)

Do these tasks in order. You will feel the tool instead of just reading about it.

- Install or run the tool locally (or in Docker) and verify it works with a hello-world action.

- Create a minimal config and run the most common command 3 times (with a small change each time).

- Break something on purpose and document how you debugged it in your Notes.

Interview prompts

Use these to test if you truly understand the basics (and can explain them clearly).

- Explain the tool’s role in a real CI/CD pipeline from commit to production.

- Describe the most common failure you’ve seen with this tool and how you fixed it.

- What would you monitor/alert on for this tool in production?

Official Docs

https://www.elastic.co/docs