Journal as scoped evidence
Filter logs by unit, boot, priority, and time window.
journalctl -u
25 min read, 30 min lab
operator
`journalctl` is useful when scoped. Unit filters, boot filters, priority filters, and time windows turn a wall of logs into evidence. Always report the scope you used.
A service failed after the last reboot and you need logs from that boot only.
Worked command
$ journalctl -u nginx.service -b --no-pager$ journalctl -u nginx.service -S '1 hour ago' -p warning$ journalctl -xeu nginx.service
Do not paste unfiltered journal output and call it an investigation.
State unit, boot/time window, and priority when reporting logs.
You run `journalctl -u nginx.service -b`. What exactly does the `-b` restrict the output to?
Show the answer
Correct: A. Only log lines from the current boot
`-b` scopes to the current boot (use `-b -1` for the previous one); it is a time/session filter, not a process or buffer filter. The 'bottom line' guess confuses it with `-e`/`-n`, which control paging and line count.
Practice checklist
- Use a lab unit or sample output.
- Collect unit-scoped logs.
- Repeat with a time window.
Deliverable evidence
- A log excerpt with unit and time scope stated.
shows: Active, enabled, logs, and unit-file are four independent questions, and that a unit edit needs daemon-reload before systemd acts on it.
does not prove: It shows which checks to run, not their results: a green "active" box is a snapshot, not proof the service is healthy or will survive the next reboot.
Commit these to memory, then drill them until recall is automatic.
cue A service failed after the last reboot; show only this boot's logs for it
show recall target
journalctl -u <unit> -b