Linux: Advanced Filtering and Analyzing System Logs with journalctl

What is journalctl Filters? You can use filters with journalctl to narrow down and control which log entries are displayed. journalctl supports a wide range of filtering options, both by structured fields and by command-line flags. Structured Fields: SYSLOG_IDENTIFIER, _SYSTEMD_UNIT, _UID, etc Command-Line Fields: --since, --until, -u, -p, --grep, etc Common journalctl Filters Filter Type Example Command Description By Time journalctl --since "8 hours ago" Shows logs since a specific time By Service/Unit journalctl -u nginx.server Show logs for a specific server/unit By Priority journalctl -p warning Show logs at/above a certain severity By Field journalctl SYSLOG_IDENTIFIER=sudo Show logs where a field matches a value By Boot journalctl -b -1 Shows logs from the previous boot By Keyword journalctl --grep "error" Shows logs containing a keyword Advanced journalctl Filters Filter Type Example Command Description By User ID journalctl _UID=user_id Filter logs by the user ID of the process that generated them By Group ID journalctl _GID=group_id Filter logs by the group ID of the process that generated them By Process ID journalctl _PID=process_id Filter logs by process ID By Process name journalctl _COMM=nginx Filter by process name (eg. _COMM=nginx) By Hostname journalctl _HOSTNAME=hostname Filter logs by hostname By Executable Path journalctl _EXE=exe_path Filter logs by executable path (eg: /usr/local/bin/hugo) By Boot Session journalctl _BOOT_ID=boot_id Filter logs by a specific boot session By Audit Session journalctl _AUDIT_SESSION=session_id Filter logs by audit session ID By Syslog Facility Code journalctl _SYSLOG_FACILITY=facility_number Filter by syslog facility code Alternatively, you can find the available filters in journalctl by using: ...

June 30, 2025 ยท 2 min ยท Yashwanth Rathakrishnan
systemd-screenshot

Linux: Service Management with systemd

Checking Service Status In Detail The systemctl status command provides detailed information about a service, including itโ€™s current state (active, inactive, failed), recent log entries, and reasons for failure if the service is not running. Example Command: sudo systemctl status apache2 #or httpd service sudo systemctl status httpd Output: iamyaash@pi5:~ $ sudo systemctl status firewalld.service โ— firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/lib/systemd/system/firewalld.service; enabled; preset: enabled) Active: active (running) since Sun 2025-06-29 20:30:48 IST; 1s ago Docs: man:firewalld(1) Main PID: 7956 (firewalld) Tasks: 2 (limit: 9585) CPU: 279ms CGroup: /system.slice/firewalld.service โ””โ”€7956 /usr/bin/python3 /usr/sbin/firewalld --nofork --nopid Jun 29 20:30:48 pi5 systemd[1]: Starting firewalld.service - firewalld - dynamic firewall daemon... Jun 29 20:30:48 pi5 systemd[1]: Started firewalld.service - firewalld - dynamic firewall daemon. The output includes: ...

June 29, 2025 ยท 3 min ยท Yashwanth Rathakrishnan
systemd-screenshot

Linux: Task Scheduling with systemd Timers

Practical guide to systemd timers, covering the differences from cron, the structure of timer files, key directives, and hands-on exercises.

June 29, 2025 ยท 3 min ยท Yashwanth Rathakrishnan
systemd-screenshot

Linux: Creating and Customizing systemd Units

Important directives: ExecStart, ExecStop, Restart policies; Dependencies and ordering: Requires, Wants, Before, After; Writing your own service units with examples; Overriding units using drop-in configurations (systemctl edit)

June 29, 2025 ยท 4 min ยท Yashwanth Rathakrishnan

Linux: Manage File Permissions

This guide explains how to use Linux commands to manage file permissions, ownership and special permissions. Commands: chmod, chown, and chgrp.

June 27, 2025 ยท 3 min ยท Yashwanth Rathakrishnan

Linux: How To Mount And Un-Mount Permanently/Temporarily

Know how to mount and unmount storage effectively for temporary and permanent storage.

June 26, 2025 ยท 1 min ยท Yashwanth Rathakrishnan

Linux: Assigning Permissions and Group Ownership Automatically For Newly Created Files & Directories (umask & chgrp)

To ensure that new files created in a shared directory are automatically assigned to the directoryโ€™s group rather than the group of the user who created them.

June 25, 2025 ยท 2 min ยท Yashwanth Rathakrishnan
systemd-screenshot

Linux: firewalld & iptables

Firewalls in Linux system administration, focussing on both firewalld and iptables.

June 24, 2025 ยท 3 min ยท Yashwanth Rathakrishnan

Linux Tools: dd Utility Tool

dd is a Linux tool, and it widely used for Linux system administration and is essential for many low-level tasks involving disks, partitions, and files at the block level.

June 22, 2025 ยท Yashwanth Rathakrishnan

Linux: Log Analysis and Journals

Understanding Linux log locations, using journalctl, analyzing traditional logs, filtering and searching logs with grep, less and time filters.

June 22, 2025 ยท 3 min ยท Yashwanth Rathakrishnan