Stop hunting through journald time gaps
Logging & Journald
Stop hunting through journald time gaps
🧩 The Challenge
Dealing with a service that crashes intermittently is a nightmare when you have to calculate timestamps to see what happened five minutes before the death spiral. I’ve wasted hours manually scrolling through systemd logs just to realize I missed the actual error by a few lines.
💡 The Fix
You can use the –since and –until flags with relative time offsets to surgically extract logs around a specific event, saving your sanity and your eyes. It turns a haystack search into a precision operation.
journalctl -u my-service.service --since "10 minutes ago" --until "now"
⚙️ Why It Works
Systemd’s log parser is surprisingly smart about parsing human-readable duration strings, so you don’t have to break out a calculator or fumble with epoch timestamps. It just looks at the journal metadata and slices the output exactly where you told it to.
🚀 Pro-Tip: Pipe it to cat if you need to grep through those specific ten minutes without pager interference.
Linux Tips & Tricks | © ngelinux.com | 7/12/2026
