Use it when you need evidence for a failure or a security event.
Log Analysis
Log analysis is reading logs to find what happened: filtering by time, unit, priority and keywords, and correlating events across services and hosts.
1. Time window: journalctl --since '…' --until '…'.
2. Priority: -p warning / -p err.
3. Unit: -u <svc>; kernel: -k.
4. Keyword: journalctl -g '<regex>' or grep -E.
5. Correlate with other hosts (NTP synchronised).
time window → source → priority → keyword → first error → correlation
For Linux Troubleshooting → Log Analysis, continue with the first unproven Topic check: Define incident start/end and original transaction/correlation identifiers. If that boundary is healthy, advance to the adjacent check: Verify clock, boot ID, source/unit/PID plus journal/file retention and query scope. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
journalctl --since '10 min ago' -p warningVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
Healthy evidence: a reproducible incident timeline links authoritative records to the same transaction, the first failing step is supported by multiple aligned signals and recovery is confirmed with fresh evidence.
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Define incident start/end and original transaction/correlation identifiers.
- Verify clock, boot ID, source/unit/PID plus journal/file retention and query scope.
- Build a timeline across kernel, service, security, network/storage and application evidence, separating precursor from consequence.
- Test the hypothesis against a reproduction and confirm recovery with fresh logs plus original workload success.
Step 3 Commands Verify boundary
journalctl --since '10 min ago' -p warning
grep -c ' 500 ' access.log
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: grep for error is treated as diagnosis, timezone/boot boundaries are ignored, missing logs are assumed to mean no event, or downstream errors are labeled root cause without reproduction.
Step 5 Common mistakes Narrow the fault
- Searching logs without a time window.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Filter first, read second. Use journalctl -o short-precise for exact times and --since/--until. Correlate across hosts only with synchronised clocks. Look for the first error, not the loudest.
journalctl -b -p err— errors this bootsystemctl --failed— failed unitsdf -h; df -i— space and inodesss -tulpn— listening socketsdmesg -T | tail— recent kernel messages
ReferenceWhat it is1 section · depth on demand
Core model
Anchor analysis to the original transaction and incident window. Normalize host/boot/timezone, source/unit/PID and correlation identifiers, verify logging coverage/retention, then compare precursor, failure and recovery events across relevant layers.
ReferenceImportant terms & boundaries4 sections · depth on demand
What this shows and what it does not
Log Analysis owns cross-layer log interpretation during troubleshooting; Logging owns collection/retention mechanics and specialist branches own domain-specific event meaning.
In depth
Build a timeline, not a grep
$ journalctl --list-boots | tail -3
-2 3f1c… Mon 2026-11-23 06:01:12 CET — Wed 2026-11-25 22:14:03 CET
-1 a92e… Wed 2026-11-25 22:16:40 CET — Fri 2026-11-27 03:12:55 CET
0 c7d0… Fri 2026-11-27 03:15:21 CET — Fri 2026-11-27 10:52:10 CET
$ journalctl -b -1 -p warning --since '2026-11-27 02:50' --until '2026-11-27 03:13' -o short-precise
$ journalctl -u nginx -u php-fpm --since -1h
$ journalctl _PID=2211
$ journalctl -k -b -1 | tail -50 # kernel messages before the unexpected reboot
The journalctl manual documents -b -1 (previous boot), --list-boots, --since/--until, -p priority filters, -u units, -o json output and field matches (FIELD=VALUE; different fields AND, same field OR).
A method that finds the first cause
1. Fix the window from the incident report (time zone!).
2. Pull warnings and errors for all units in that window (-p warning).
3. Sort mentally by time; find the first abnormal message, not the loudest.
4. Follow that unit or PID with full detail (-u <unit> -o verbose).
5. Confirm with an independent source (metrics, application log, remote syslog).
Structured fields beat text search
journalctl -o json --since -10min | jq -r 'select(.PRIORITY|tonumber <= 3) | "\(.__REALTIME_TIMESTAMP) \(._SYSTEMD_UNIT) \(.MESSAGE)"'
journalctl -F _SYSTEMD_UNIT --since today # which units logged at all today
journalctl SYSLOG_IDENTIFIER=sshd -g 'Failed password'
Previous boot empty?
If journalctl -b -1 shows nothing, the journal is volatile (in /run) — enable persistent storage (mkdir -p /var/log/journal or Storage=persistent) before the next incident. An abrupt end of the previous boot without shutdown messages suggests power loss, a hard reset or a kernel crash (check kdump//var/crash).
Application logs outside the journal
Many applications write their own files (/var/log/nginx/error.log). Correlate them by timestamp with the journal; mismatched clocks between hosts make cross-host timelines misleading — check time sync first.
*The journal boot identifiers and timestamps are fictional entries for demonstrating incident timeline queries.*
How it works at runtime
Log Analysis is part of Linux Troubleshooting → Log Analysis. Log Analysis is the troubleshooting discipline for turning Linux journal/syslog/application records into time-correlated evidence without confusing noisy messages, missing collection or downstream symptoms with causation.
Topic-specific state model. Log Analysis is the troubleshooting discipline for turning Linux journal/syslog/application records into time-correlated evidence without confusing noisy messages, missing collection or downstream symptoms with causation.
Interpretation rule. - Error severity ≠ causal importance.
- Nearest timestamp ≠ same transaction without identity/correlation evidence.
- No result from a query ≠ no event occurred.
- Repeated message ≠ repeated independent root causes.
Method
Log analysis on Linux:
journalctl -b -p warning..alert
journalctl -u nginx --since '2026-11-05 09:00' --until '09:30'
journalctl -k -b -1 # kernel log from previous boot
journalctl _PID=1234; journalctl _COMM=sshd
journalctl -o json-pretty -n 1
grep -E 'error|fail' /var/log/nginx/error.log | tail
zgrep 'Failed password' /var/log/auth.log* | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head
Make the journal persistent (/var/log/journal, Storage=persistent) to keep logs across reboots, and centralise logs (rsyslog/journald forwarding, Loki/Elastic) so evidence survives host failure.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Log Analysis owns cross-layer log interpretation during troubleshooting; Logging owns collection/retention mechanics and specialist branches own domain-specific event meaning.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Linux Troubleshooting → Log Analysis. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.kernel.org/ · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Log Analysis operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Log Analysis.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Log Analysis is the troubleshooting discipline for turning Linux journal/syslog/application records into time-correlated evidence without confusing noisy messages, missing collection or downstream symptoms with causation. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin symptom + exact time + host/boot/user → define scope + expected baseline → preserve original failing test → collect targeted kernel/process/service/storage/network/security/log evidence → identify first divergent boundary → make one minimal reversible change → repeat original test → verify adjacent regressions and retain before/after evidence. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | symptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture check | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Log Analysis troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux troubleshooting evidence can establish this proof path: symptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture check | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove behavior outside the captured host, boot, process/user, dependency, time or workload scope. Log Analysis troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven boundary: reproduce the exact original failure, collect the owning subsystem evidence at the same time, change only the proven cause or prerequisite, then repeat the original workload and regression checks. | Continue to the next unresolved boundary while preserving the original test condition. |
Log Analysis · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Log Analysis |
|---|---|
| Topic path | Linux Troubleshooting → Log Analysis |
| Runtime state | Log Analysis is the troubleshooting discipline for turning Linux journal/syslog/application records into time-correlated evidence without confusing noisy messages, missing collection or downstream symptoms with causation. |
| Fast checks | - Define incident start/end and original transaction/correlation identifiers. - Verify clock, boot ID, source/unit/PID plus journal/file retention and query scope. - Build a timeline across kernel, service, security, network/storage and application evidence, separating precursor from consequence. - Test the hypothesis against a reproduction and confirm recovery with fresh logs plus original workload success. |
| Verification chain | symptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture check Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary. |
| Failure boundary | Log Analysis troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |