diff options
| author | Daniel C. Sobral <dcs@FreeBSD.org> | 2002-09-23 11:59:19 +0000 |
|---|---|---|
| committer | Daniel C. Sobral <dcs@FreeBSD.org> | 2002-09-23 11:59:19 +0000 |
| commit | f50b861cbf094fefaf72ae42f5642015fd34a9ca (patch) | |
| tree | 920d9cf95b394860bd5f156145e6f6892d2dc1c1 | |
| parent | 4712aa3b5901a905ad20cfa26067cc10012ff421 (diff) | |
Notes
| -rw-r--r-- | usr.sbin/syslogd/syslog.conf.5 | 11 | ||||
| -rw-r--r-- | usr.sbin/syslogd/syslogd.c | 16 |
2 files changed, 25 insertions, 2 deletions
diff --git a/usr.sbin/syslogd/syslog.conf.5 b/usr.sbin/syslogd/syslog.conf.5 index 18579a3054cdc..099b9cb0fc0c4 100644 --- a/usr.sbin/syslogd/syslog.conf.5 +++ b/usr.sbin/syslogd/syslog.conf.5 @@ -185,6 +185,17 @@ specification for .Ql foo will also match any message logged by the kernel with the prefix .Ql "foo: " . +The +.Ql #!+prog +or +.Ql !+prog +specification works just like the previous one, +and the +.Ql #!-prog +or +.Ql !-prog +specification will match any message but the ones from that +program. A .Em hostname specification of the form diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 999254a15c8bf..c3887acb170eb 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -853,8 +853,20 @@ logmsg(int pri, const char *msg, const char *from, int flags) /* skip messages with the incorrect program name */ if (f->f_program) - if (strcmp(prog, f->f_program) != 0) - continue; + switch (f->f_program[0]) { + case '+': + if (strcmp(prog, f->f_program + 1) != 0) + continue; + break; + case '-': + if (strcmp(prog, f->f_program + 1) == 0) + continue; + break; + default: + if (strcmp(prog, f->f_program) != 0) + continue; + break; + } if (f->f_type == F_CONSOLE && (flags & IGN_CONS)) continue; |
