journalctl Notes
Show logs since a specific time
journalctl --since yesterday
journalctl --since "1 hour ago"
journalctl --since "2020-09-03 12:34"Show logs for a specific systemd unit
journalctl -u haproxy.serviceShow logs for several units together
journalctl -u varnish.service -u hitch.service --since todayShow logs by executable
journalctl /usr/bin/bashDisplay kernel messages
journalctl -kOutput journal entires as JSON
journalctl -b -u nobody -o jsonor formatted JSON
journalctl -b -u nobody -o json-prettySupported output formats:
- cat: Only the message field
- export: Binary format for backup or transfer
- json: One-line per entry standard JSON
- json-pretty: Human readable JSON
- json-sse: Server-sent event compatible JSON
- short: Default
syslogstyle output - short-iso: Default with ISO 8601 timestamps (
YYYY-MM-DDTHH:mm:SS+TZ) - short-monotonic: Default with monotonic timestamps since boot (
[ 1.817288]) - short-precise: Default with microsecond precision timestamps (
Aug 24 18:49:58.244998) - verbose: Include every available field in each journal entry
Show the n most recent entries (defaults to 10)
journalctl -n nFollow logs
journalctl -fShow current journal disk consumption
journalctl --disk-usageDelete old journal entries
journalctl --vacuum-size=1G
journalctl --vacuum-time=1years
Comments
Post a Comment