KatInterview

Triaging an Outage from Giant Logs, Then Building Log Search

System DesignModel answer
MediumModel answerSystem Designloggingobservabilityincident-response

Last updated

Find the cause of a production failure using only SSH and huge log files, then design a centralized logging platform and justify the storage and cost trade-offs.

A service in production has started failing. All you have is an SSH session to one affected host, and the log files on it are tens of gigabytes.

Part 1: Single-host triage

Describe how you would find the relevant errors and the time window in which things went wrong. Be specific about:

  • the commands, filters and tools you would use,
  • how you would avoid making a struggling host worse,
  • how you would turn raw log lines into a conclusion (when it started, what the dominant error is, what changed).

Part 2: Centralized logging

Suppose this kind of incident keeps happening. Design a centralized logging and search system that would make this triage fast and routine. Cover:

  • requirements and a rough scale estimate,
  • the ingestion path and where data is buffered,
  • storage tiers, indexing and retention,
  • the query and alerting experience,
  • failure modes and the trade-offs you would weigh (cost, latency, completeness, privacy).

Aim for a structured answer: state your assumptions, justify each choice, and say how you would verify that the fix or design works.

Hints

Hint 1

Before searching, check whether the host itself is sick (disk, inodes, memory, OOM kills, recent restarts), and look at the end of the file first because the newest events are there.

Hint 2

Narrow by time window before searching by content, then aggregate (count per minute, group similar messages after stripping IDs) instead of reading lines. Use correlation IDs to follow one failing request.

Hint 3

For the design, size the volume first (hosts x GB/day), then decide what must be fully indexed versus cheaply archived. Put a durable buffer between agents and the index, and plan for bursts and PII.