Ga naar de inhoud
Home » Systemd journal viewing

Systemd journal viewing

Alles vanaf het booten tot nu:

journalctl -b

Alles vanaf een bepaald tijdstip:

journalctl --since "YYYY-MM-DD HH:MM:SS"

Alles tussen twee tijdstippen:

journalctl --since"YYYY-MM-DD HH:MM:SS" --until "YYYY-MM-DD HH:MM:SS"

Bij tijdspecificatie gebruik formaat YYYY-MM-DD HH:MM:SS. Als de datum mist wordt uitgegaan van vandaag, mist de tijdsaanduiding dan wordt uitgegaan van 00:00:00.

Journalctl begrijpt ook

  • yesterday
  • today
  • tomorrow
  • now

Log van 1 unit:

journalctl -u dhcpd.service

Log van een process:

journalctl _PID=8088

Log van een user:

journalctl _UID=33

Log van een group:

journalctl _GID=5

Log van een executable:

journalctl /usr/bin/sh

Log van de kernel (dmesg):

journalctl -k

Log naar prioriteit:

journalctl -p err

Prioriteit is gespecificeerd als:

  1. emerg
  2. alert
  3. crit
  4. err
  5. warning
  6. notice
  7. info
  8. debug

Afbreken van output:

journalctl --no-full

Volledige output:

journalctl -a

Geen pager gebruiken:

journalctl --no-pager

Ander formaat van output:

journalctl -o json-pretty

Toegestane formaten zijn:

  • at: Displays only the message field itself.
  • export: A binary format suitable for transferring or backing up.
  • json: Standard JSON with one entry per line.
  • json-pretty: JSON formatted for better human-readability
  • json-sse: JSON formatted output wrapped to make add server-sent event compatible
  • short: The default syslog style output
  • short-iso: The default format augmented to show ISO 8601 wallclock timestamps.
  • short-monotonic: The default format with monotonic timestamps.
  • short-precise: The default format with microsecond precision
  • verbose: Shows every journal field available for the entry, including those usually hidden internally.

Geef laatste x regels weer:

journalctl -n 50

Opschonen van de log:

journalctl --vacuum-size=1G

Zie ook https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs