Syslog-ng loghost - 过滤器不匹配

Syslog-ng loghost - 过滤器不匹配

我在从 syslog-ng OSE 接收远程日志时遇到了问题。我正在配置日志主机,但现在我不知道我做错了什么。似乎过滤器对从远程主机接收的日志不起作用。

这是我的与 loghost 相关的配置的一部分:

客户(syslog-ng 3.3.5)(它运行良好,因为日志到达了日志主机 - 我以调试模式运行它,因此我能够确认这一点)

destination d_net { syslog("10.20.8.2" transport ("tcp") port(514) ); };
filter f_auth { facility(auth, authpriv) and not filter(f_debug); };
log { source(s_src); filter(f_auth); destination(d_net); };

服务器(syslog-ng 3.2.5 - 我的服务器系统日志-ng.conf部分:

source s_network { tcp(); udp(); };
destination d_loghost_auth { file("/opt/logs/sys/$YEAR-$MONTH-$DAY/auth.log" create_dirs(yes) ); };
filter f_loghost_auth { facility(auth) or facility(authpriv) };
log { source(s_network); filter(f_loghost_auth); destination(d_loghost_auth); };

因此,当我在调试和详细模式下运行服务器并使用记录器(从客户端)对其进行测试时:

logger -n 10.20.8.2 -p auth.info "auth.info test syslog"

我得到这个:

Incoming log entry; line='95 <38>1 2014-12-17T13:03:16+01:00 ibanez logger - - [meta sequenceId="65"] auth.info test syslog'
Filter rule evaluation begins; filter_rule='f_loghost_auth'
Filter node evaluation result; filter_result='not-match', filter_type='facility'
Filter node evaluation result; filter_result='not-match', filter_type='facility'
Filter node evaluation result; filter_result='not-match', filter_type='OR'
Filter rule evaluation result; filter_result='not-match', filter_rule='f_loghost_auth'

我不认为版本不匹配是原因。我将非常感激任何形式的帮助!

答案1

问题是我使用了 tcp() 和 udp() 源驱动程序 [BSD 格式] 而不是 syslog() [IETF 格式]。现在可以正常工作了。

相关内容