Linux Commands / IT Support Guides
Filter systemd logs to an incident window
Use journalctl to read recent messages for one systemd service.
Environment and inputs: Linux · Bash-compatible shell; package and service names vary by distribution
Understand the problem
Identify the unit and the approximate time the problem began. Use an account allowed to read the relevant journal.
Run the command
The example uses -u nginx to select messages for the Nginx unit and --since to show entries from the last 30 minutes. --no-pager prints the result directly to the terminal.
journalctl -u nginx --since '30 minutes ago' --no-pager
Read the output
Read the timestamps and look for the first error near the reported time. Later messages may describe retries or shutdown rather than the original failure.
Choose the next step
If there are no entries, verify the unit name, time window, and permissions. Some applications also write separate log files.
Before making changes
Save the few lines needed to explain what happened. Remove credentials and personal information before sharing excerpts.