2
我在运行Red Hat 6的服务器上使用统一日志,从其他服务器接收定向日志消息并使用RSyslog管理它们。到现在为止,/etc/rsyslog.conf有这样的规则:如何在Red Hat上过滤远程系统日志消息?
if $fromhost-ip startswith '172.20.' then /var/log/mylog.log
但我不希望记录包含“核心”和“DNAT”的消息,所以我要筛选的所有邮件,加强规则。
我该怎么做?
我做到了!这就是: 如果($ fromhost-ip startswith'172.20。',而不是$ msg包含'kernel'),那么/ var/log/mylog.log' – digofreitas