MyNixOS website logo
option

services.journalwatch.filterBlocks

filterBlocks can be defined to blacklist journal messages which are not errors. Each block matches on a log entry field, and the filters in that block then are matched against all messages with a matching log entry field.

All messages whose PRIORITY is at least 6 (INFO) are processed by journalwatch. If you don't specify any filterBlocks, PRIORITY is reduced to 5 (NOTICE) by default.

All regular expressions are extended Python regular expressions, for details see: http://doc.pyschools.com/html/regex.html.

Declarations
Type
list of (submodule)
Default
[
  {
    filters = ''
      (Stopped|Stopping|Starting|Started) .*
      (Created slice|Removed slice) user-\d*\.slice\.
      Received SIGRTMIN\+24 from PID .*
      (Reached target|Stopped target) .*
      Startup finished in \d*ms\.
    '';
    match = "SYSLOG_IDENTIFIER = systemd";
  }
]
Example
[
  {
    filters = ''
      New session [a-z]?\d+ of user \w+\.
      Removed session [a-z]?\d+\.
    '';
    match = "_SYSTEMD_UNIT = systemd-logind.service";
  }
  {
    filters = ''
      pam_unix\(crond:session\): session (opened|closed) for user \w+
      \(\w+\) CMD .*
    '';
    match = "SYSLOG_IDENTIFIER = /(CROND|crond)/";
  }
]