Good Linux/Sysadmin practice would recommend you go with something like fzbd's solution in which you're silencing the specific log you don't need to see rather than disabling kernel messages wholesale.
Nevertheless, it's still worth mentioning that as of systemd 235, there's an option for disabling kernel messages within journald.conf
file. The main journal.conf docs mention this option which allows you to disable journald from reading /dev/kmsg
.
Version 235 may not be found in many distributions just yet, so you can check your systemd version with:
systemctl --version
If you have version 235 or above you can proceed by first making a backup of the original /etc/systemd/journald.conf file and then uncommenting the relevant line and changing it from yes
to no
:
ReadKMsg=no
Save, exit, and restart your journald service:
sudo systemctl restart systemd-journald.service