syslog-ng无法从ASA捕获系统日志

我的syslog-ng.conf:

@version: 3.0 # Default configuration file for syslog-ng. # # For a description of syslog-ng configuration file directives, please read # the syslog-ng Administrator's guide at: # # http://www.balabit.com/dl/html/syslog... # options { flush_lines (0); time_reopen (10); log_fifo_size (10000); use_dns (no); use_fqdn (no); create_dirs (no); keep_hostname (yes); ts_format (rfc3164); }; ###### # sources source s_local { # message generated by Syslog-NG internal(); # standard Linux log source (this is the default place for the syslog() # function to send logs to) unix-stream("/dev/log"); # messages from the kernel file("/proc/kmsg" program_override("kernel: ")); }; source all_tcp { tcp(ip(0.0.0.0) port(1470)); }; source all_udp { udp(ip(0.0.0.0) port(514)); }; ###### # destinations destination d_messages { file("/var/log/messages"); }; destination d_perf_test { file("/apps/logs/syslog_ng/perf_test.1"); }; destination d_prod { file("/apps/logs/syslog_ng/prod.1"); }; destination d_dr { file("/apps/logs/syslog_ng/dr.1"); }; destination d_covad { file("/apps/logs/syslog_ng/covad.1"); }; filter f_perf_test { (host(10.253.16.1) or host(10.253.16.111) or host(10.253.99.1) or host(10.253.16.100) or host(10.253.7.1) or host(10.253.16.101) or host(10.253.16.102) or host(10.253.16.103) or host(172.21.189.128) or host(172.21.189.129) or host(172.21.154.128) or host(172.21.148.128) or host(10.253.8.1)or host(10.253.8.111) or host(172.20.111.10) or host(10.253.8.112) or host(10.253.8.100) or host(10.253.8.101) or host(10.253.8.224) or host(10.253.8.225)); }; filter f_prod { (host(10.253.253.1) or host(10.253.253.3) or host(10.253.253.4) or host(10.253.12.100) or host(10.253.12.1) or host(10.253.12.101) or host(10.253.12.102) or host(10.253.12.103) or host(172.19.189.128) or host(172.19.189.129) or host(172.19.154.128) or host(172.19.148.128) or host(10.253.13.100) or host(10.253.13.1) or host(10.253.13.101) or host(10.253.13.224) or host(10.253.13.225) or host(10.253.101.10)); }; filter f_dr { (host(10.253.253.101) or host(10.253.253.103) or host(10.253.253.104) or host(10.253.253.105) or host(10.253.112.100) or host(10.253.112.1) or host(10.253.112.101) or host(10.253.112.102) or host(10.253.112.103) or host(172.29.189.128) or host(172.29.154.128) or host(172.29.148.128) or host(172.29.148.28) or host(10.253.113.100) or host(10.253.113.1) or host(10.253.113.101) or host(10.253.113.224) or host(10.253.113.225)); }; filter f_covad { (host(10.253.99.150) or host(10.253.99.1)); }; log { source(s_local); destination(d_messages); }; log { source(all_udp); filter(f_perf_test); destination(d_perf_test); }; log { source(all_udp); filter(f_prod); destination(d_prod); }; log { source(all_udp); filter(f_dr); destination(d_dr); }; log { source(all_udp); filter(f_covad); destination(d_covad); }; 

===================================

Syslog-ng能够捕获除了10.253.99.1和10.253.99.150之外的所有其他源,其目的地是f_covad

问题:我的configuration是否正确? 是否有任何其他选项可能有利于解决这个问题?

我如何检查我的网卡是否从covad源接收日志?

如何检查syslog-ng是否正在监听并能够从covad地址读取系统日志消息?

任何帮助将不胜感激。

在过去,我select引用IP地址作为filterstring主机部分的一部分。 因此,以此为例,您应该进行以下更改:

 filter f_covad { (host("10.253.99.150") or host("10.253.99.1")); }; 

否则,我没有看到你的configuration错误。 接下来,您应该检查您的主机防火墙,以查看UDP端口514是否从您的日志源打开。 接下来是看日志是否甚至使这一点 。 我经常喜欢testing系统日志stream量的接收是简单地使用tcpdump。 它将parsing消息并显示适当的数据。 例如:

 packs@ node1:~> sudo tcpdump -i eth0 port 514 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes 13:53:35.633091 IP remote.host.local.47007 > node1.local.syslog: SYSLOG user.info, length: 688 13:53:35.646322 IP remote.host.local.47007 > node1.local.syslog: SYSLOG local5.info, length: 204 13:53:35.654178 IP remote.host.local.47007 > node1.local.syslog: SYSLOG local5.info, length: 204 

这给了我们所有的信息,我们需要看看消息是否到达主机。

我喜欢稍微不同的组织我的syslog-ngconfiguration,以便每个log定义有flags(final); 喜欢这个:

 log { source(s_src); filter(f_auth); destination(d_auth); flags(final); }; 

这允许我在configuration的底部有一个“全部捕获”日志。

 destination d_catchall { file("/var/log/$YEAR/$MONTH/catchall.$DAY.log" template("$DATE $FULLHOST $PROGRAM $MSG\n") template_escape(no)); }; #filter f_catchall { not host("192.168.0.254"); }; #log { source(s_src); filter(f_catchall); destination(d_catchall); }; log { source(s_src); destination(d_catchall); }; 

在文件早期没有显式logging的任何东西都logging在search日志中。 这意味着我永远不会把任何日志放在地板上。 当DNS条目丢失或者仅input错误的IP地址时,匹配正确的程序或标签名称或使用基于主机的名称是非常容易的。

当我需要或者想要忽略某些日志时,例如某些服务在debug级别上进行日志logging时,可以看到两条注释掉的行,但实际上我并不想存储所有这些日志。