Updated: 28 September 2026 · Applies to: rsyslog 8 on AlmaLinux 9, Rocky Linux 9, Ubuntu 24.04 and Debian 12
rsyslog can drop unwanted messages or send them to a separate file, based on their content or program name.
Examples
Create /etc/rsyslog.d/10-filters.conf:
# discard messages containing this text :msg, contains, "unwanted text" stop # send messages from one program to its own file, then stop :programname, isequal, "myapp" /var/log/myapp.log & stop
Restart rsyslog: systemctl restart rsyslog. The old ~ discard action still works but stop is the current syntax.
Ucartz services for this topic
- KVM VPS hosting: NVMe SSD and full root access, with Free Basic Managed Support.
- Unmanaged dedicated servers: full root access and free IPMI KVM, with Free Basic Managed Support.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
