Export journald logs to JSON
Export logs as structured JSON (time and message), for example to send them to a log aggregator.
journalctl -u <service> -o json | jq '{ts: .REALTIME_TIMESTAMP, msg: .MESSAGE}'
- tool
- linux133 commands
More linux commands
-
timedatectl status && chronyc trackingShow clock sync state, time offset and NTP source details.
-
systemctl list-timers --all --no-pagerList all timers with their last and next run times.
-
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@hostAdd your public key to authorized_keys on a remote host.
-
rsync -avz --progress --delete src/ user@host:/dest/Mirror a directory to a remote host and delete files that are not in the source.
-
shred -vzn 1 /dev/sdbOverwrite the disk once with random data, then with zeros, and show progress. For SSD and NVMe, use the drive's built-in secure erase instead.