Log Analysis and Diagnostic Data Gathering Questions

Extracting signal from existing logs and diagnostic output to find a root cause: parsing and querying log data, correlating traces and metrics during an investigation, and gathering the right diagnostic information (including asking clarifying questions) before drawing conclusions. Covers text-processing and query techniques for locating evidence in logs (structured log parsing, ElasticSearch/SQL-style log queries, log aggregation and retention trade-offs) and reconstructing a timeline from the data on hand. This is the analysis-of-existing-data skill used during troubleshooting and investigation across infrastructure and operations roles: distinct from monitoring and observability, which is about instrumenting a system so telemetry exists in the first place (see the observability topics for that), and distinct from SIEM-based security detection and formal digital-forensics practice (chain of custody, artifact/disk/memory analysis), which have their own dedicated coverage elsewhere in the catalog.

MediumTechnical
33 practiced

Write a Python 3 script that reads a newline-delimited log file where each line is a JSON object with keys: "timestamp" (ISO 8601), "service", "level", "message". The script should output per-minute error counts (level == "ERROR") for a given service over the last 60 minutes, printing lines like: 2025-03-12 14:05 3. The log may be out-of-order and can be large (~10GB): prioritize streaming and bounded memory.

EasyTechnical
34 practiced

Demonstrate practical journalctl usage: give commands and short explanations for the following tasks:

  1. List all boots and show the last boot's ID
  2. Show logs for unit nginx.service filtered to warning and above
  3. Follow logs in real time for a unit
  4. Export journal entries in JSON for downstream parsing

Also explain the significance of fields like _SYSTEMD_UNIT and _PID in the journal.

MediumTechnical
36 practiced

During an incident retro, you go looking for the application log from four days ago and it's gone; only the last couple of days of rotated files still exist. Walk through how you'd figure out whether that's expected retention behavior or a rotation misconfiguration, and what you'd check or change so it doesn't bite the next investigation.

EasyTechnical
32 practiced

Describe a small utility or automation (pseudocode or high-level steps) you would implement in Python to scan metrics or logs and identify the top services with rising error rates over a sliding 24-hour window. State inputs, outputs, aggregation method, and threshold logic.

MediumTechnical
42 practiced

Write (or outline) a Python script that reads a large log file (streaming, may not fit in memory) of timestamped events where each line is: "ISO8601_TIMESTAMP LEVEL message". Implement an approach to identify the top-3 sliding 5-minute windows with the highest error (LEVEL=ERROR) rate and report window start, end, and error count. Explain complexity and streaming constraints.

Unlock Full Question Bank

Get access to all 27 Log Analysis and Diagnostic Data Gathering interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.