]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add property-based filters for syslogd.
authorAndrey V. Elsukov <ae@FreeBSD.org>
Thu, 26 Mar 2020 11:54:25 +0000 (11:54 +0000)
committerAndrey V. Elsukov <ae@FreeBSD.org>
Thu, 26 Mar 2020 11:54:25 +0000 (11:54 +0000)
commit7d367c51c834fdb005b7fa3f94858fdba57d7760
treea398f4c8b30ac90d978937514768104a850c8d1f
parent8e76d7909d4c8c5fc60a381320acc772c98c1efd
Add property-based filters for syslogd.

Property-based filters allow substring and regular expressions
(see re_format(7)) matching against various message attributes.
Filter specification starts with '#:' or ':' followed by three
comma-separated fields property, operator, "value". Value must be
double-quoted. A double quote and backslash must be escaped by a
blackslash.

Following properties are supported as test value:
o msg - body of the message received;
o programname - program name sent the message;
o hostname - hostname of message's originator;
o source - an alias for hostname.

Supported operators:
o contains - true if filter value is found as a substring of property;
o isequal - true if filter value is equal to property;
o startswith - true if property starts with filter value;
o regex - true if property matches basic regular expression defined
    in filter value;
o ereregex - true if property matches extended regular expression
    defined in filter value;

Operator may be prefixed by '!' to invert compare logic or by
'icase_' to make comparison function case insensitive.

Submitted by: Boris N. Lytochkin <lytboris at gmail com>
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D23468
usr.sbin/syslogd/syslog.conf.5
usr.sbin/syslogd/syslogd.c