Reconstructing an incident across rotated logs
easy 7 minA log query has a source, a time range and a retention boundary.
Video lesson · Chapter 1 of 8
The missing minute after a restart
Theory
Read or listen first. About 1 min.
What it is
A log query has a source, a time range and a retention boundary. A new process can write to a different file or boot journal. Rotation can rename, compress or remove earlier segments. Joining only on wall time can misorder events when clocks differ. Boot IDs, request IDs and monotonic offsets give additional ordering evidence.
Why it exists
An application restarts during an outage and the current log starts after the first failures. Record the boot identity and deployment time, then search the previous segment and retained journal for the same request IDs. An empty query is consistent with missing collection as well as healthy behavior. Verify which hosts and intervals the query actually covers.
If the archived segment never reached the collector, report a gap in evidence and compare an independent request counter.
The missing minute after a restart
Inside this chapter
- Real-time Log Viewing with tail
- Tail follows newly appended bytes. Following a descriptor versus a filename matters across rotation because the process writing and the process observing may move to different inodes.
- Journal Queries with journalctl
- A journal query can constrain boot, unit and time. Save the query and relevant identifiers alongside the timeline so another responder can reproduce the evidence.
- Compressed Log Search with zgrep
- Compressed archives often contain the first symptom that has rotated away. Match their timestamps and sources to current segments and deduplicate any overlap.
- Log Rotation with logrotate
- Rotation changes which file receives new events and may compress or remove old segments. Retention, reopen behavior and collector checkpoints determine investigation coverage.
- Understanding /var/log Structure
- Log locations depend on distribution and application configuration. Many deployments send events to the journal or a remote collector, so an empty local directory is inconclusive.
How it works
Step through the idea, or press Play.
Mark the incident window. Record service, host, boot and request identities.
Understand it
Worked incident
The missing minute after a restart
| Observation | Trace-linked events recovered (events) | Interpretation |
|---|---|---|
| Baseline | 18 | A test transaction produces eighteen correlated events. |
| Incident | 7 | A query of only the current segment recovers seven. |
| After intervention | 18 | Include the retained previous segment and compare matched request IDs across the restart. |
Choose the next investigation
Summary
The whole topic in one minute.
Silence only supports recovery when the source was still collecting and retaining events during the interval.
If the archived segment never reached the collector, report a gap in evidence and compare an independent request counter.