Pcornel
Linux · Linux Troubleshooting

Log Analysis

Cheat sheet · https://pcornel.dk/topic.php?topic=2923

Back to the Topic

Answer

Log analysis is reading logs to find what happened: filtering by time, unit, priority and keywords, and correlating events across services and hosts.

Remember

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.

First checks

  • journalctl -b -p err — errors this boot
  • systemctl --failed — failed units
  • df -h; df -i — space and inodes
  • ss -tulpn — listening sockets
  • dmesg -T | tail — recent kernel messages

Commands

journalctl
journalctl -b -1

Verify in this order

time window → source → priority → keyword → first error → correlation

Where it usually breaks

First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2923

Confirmation

Confirm action

Continue?