Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet journald stores messages of the kernel, the boot, services and programs with many fields (unit, PID, UID, priority …). journalctl shows them, oldest first, in a pager. Filters can be combined: journalctl -u sshd -p warning --since today.
Normal users see their own messages; members of wheel, adm and systemd-journal see all. The journal is persistent only if /var/log/journal exists (or Storage=persistent).
Zo schrijf je het journalctl [OPTION]... [FIELD=VALUE]... Meest gebruikt
Filter -u, --unit=UNITMessages of a unit (pattern allowed). --user-unit=UNITMessages of a user unit. -p, --priority=PRIOPriority or range: emerg, alert, crit, err, warning, notice, info, debug (or 0-7, err..warning). -S, --since=TIMEFrom this time: today, yesterday, -1h, "2026-10-25 08:00". -U, --until=TIMEUntil this time. -b, --boot[=ID|±N|all] This boot, or another (-1 = the boot before). -k, --dmesgOnly kernel messages (implies -b). -t, --identifier=IDMessages with this syslog tag. -g, --grep=PATTERNMessages that match a regular expression. --case-sensitive[=BOOL] Case for --grep. --facility=FACILITYSyslog facility. FIELD=VALUEField filter, like _PID=1010, _UID=1001, _COMM=sudo, _SYSTEMD_UNIT=sshd.service. -c, --cursor=CURSOR, --after-cursor=CURSOR, --cursor-file=FILEStart at a saved position. Output -f, --followShow new messages live. -n, --lines=NThe last N lines (default 10). -r, --reverseNewest first. -o, --output=MODEFormat: short, short-iso, short-precise, verbose, json, json-pretty, cat, export … --output-fields=LISTFields to show with json/verbose. -x, --catalogAdd explanations from the message catalog. -a, --allShow all fields, also long or unprintable ones. -l, --full, --no-fullDo not cut / cut long lines. --no-hostnameHide the host name. --truncate-newlineOnly the first line of multi-line messages. --show-cursorPrint the cursor at the end. -q, --quietNo info messages. --no-tailWith -f: show all lines first. Sources --system, --userSystem or user journal. -m, --mergeMerge all journals (also remote ones). -D, --directory=DIRRead the journal in this folder. --file=GLOBRead these journal files. --root=ROOT, --image=IMAGE, --image-policy=POLICYRead from another root or image. --namespace=NAMEA journal namespace. -M, --machine=NAMEA container's journal. Fields and boots -F, --field=FIELDList all values of a field (like _SYSTEMD_UNIT). -N, --fieldsList all field names. --list-bootsList the stored boots. Maintenance --disk-usageSpace used by the journal. --vacuum-size=SIZEDelete old files until the journal is under this size. --vacuum-time=TIMEDelete entries older than this. --vacuum-files=NKeep only N files. --rotateStart new journal files. --flushMove the memory journal to /var/log/journal. --syncWrite all pending messages to disk. --relinquish-var, --smart-relinquish-varStop writing to /var (before unmounting it). --verifyCheck the journal files for damage. --setup-keys, --verify-key=KEY, --interval=TIME, --forceForward Secure Sealing (tamper proof logs). --list-catalog, --dump-catalog, --update-catalogMessage catalog tools. --versionShow the version. Niets past bij dit filter.
$ als gewone gebruiker# als root (of met sudo)
1 Messages of one service Kopieer # journalctl -u sshdEverything sshd logged.
2 Errors since the boot Kopieer # journalctl -p err -b The first look after a problem.
3 Follow a service live Kopieer # journalctl -fu httpdLeave it open while you test.
4 A time window Kopieer # journalctl --since "2026-10-25 08:00" --until "2026-10-25 09:00"Also: --since -2h, --since yesterday.
5 The boot before Kopieer # journalctl --list-boots
# journalctl -b -1 -p warningWhy did the server crash or reboot?
6 Kernel messages Kopieer # journalctl -k -p warningDisk, memory and driver problems.
7 All sudo commands today (audit) Kopieer # journalctl _COMM=sudo --since todayUser, folder and command of each sudo call.
8 Failed SSH logins (security) Kopieer # journalctl -u sshd --since today -g 'Failed password|Invalid user'Many lines from one IP = a brute-force attack.
9 Messages of one user Kopieer # journalctl _UID=1001 --since todayWhat lisa's processes logged.
10 All fields of one entry Kopieer # journalctl -u sshd -n 1 -o verboseShows the fields you can filter on.
11 JSON for tools Kopieer # journalctl -u myapp -o json --since -10min | jq -r '.MESSAGE'Feed a SIEM or script.
12 Explain a failure Kopieer # journalctl -xeu httpd-x adds help text, -e jumps to the end.
13 Disk use and cleanup Kopieer # journalctl --disk-usage
# journalctl --vacuum-time=30d Removes entries older than 30 days.
14 Which units logged at all? Kopieer # journalctl -F _SYSTEMD_UNIT | sort | head Lists every unit name in the journal.
15 Check the journal for damage Kopieer # journalctl --verify PASS/FAIL per file.
Niets past bij dit filter.
Let op Without a persistent journal, -b -1 shows nothing: older boots are gone. Times in --since need quotes when they contain a space. Bestanden
/run/log/journal/Journal in memory (lost at reboot).
/var/log/journal/Journal on disk (persistent).
/etc/systemd/journald.conf, /etc/systemd/journald.conf.d/journald settings. Exitcodes 0 :: Done. 1 :: Error (or no match with some options).