【发布时间】:2015-07-06 17:07:41
【问题描述】:
我开始使用 rsyslog 将日志文件数据发送到远程服务器。
我有一个开发 (server1) 和生产 (server2)。两个系统都使用相同版本的 CentOS 和 rsyslog。 rsyslog.conf 和 httpd 配置文件是相同的(保存上面的服务器名称)。
问题是其中一个系统正在将它自己的 IP 添加到 rsyslog 流中,而另一个没有。在下面的日志数据中,我的本地 IP 是 1.2.3.4,而服务器 IP 在 99.99.99.X 子网中。
server1 - CentOS 6.5(开发版,99.99.99.77)
Name : rsyslog
Arch : x86_64
Version : 5.8.10
Release : 10.el6_6
httpd 配置:
ErrorLog "| tee -a /var/log/httpd/error_log | logger -thttpd_server1_ssl_error -plocal6.err"
CustomLog "|tee -a /var/log/httpd/access_log | logger -thttpd_server1_ssl_access -plocal5.notice" 合并
rsyslog 输出: 注意只包含远程 IP...
消息:7 月 6 日 11:57:24 server1 httpd_access:1.2.3.4 - - [06/Jul/2015:11:57:23 -0400] "GET /somepage.html HTTP/ 1.1" 200 - "https://server1.top.level.domain/" "text/html" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0"
server2 - CentOS 6.5(产品,99.99.99.99)
Name : rsyslog
Arch : x86_64
Version : 5.8.10
Release : 10.el6_6
httpd 配置:
ErrorLog "| tee -a /var/log/httpd/error_log | logger -thttpd_server2_ssl_error -plocal6.err"
CustomLog "|tee -a /var/log/httpd/access_log | logger -thttpd_server2_ssl_access -plocal5.notice" 合并
rsyslog 输出: 请注意,远程和服务器 IP 都包括在内...
消息:7 月 6 日 11:58:49 server2 httpd_access:1.2.3.4 99.99.99.99 - - [06/Jul/2015:11:58:49 -0400] "GET https://server1.top.level.domain/ HTTP/1.1" 200 443 20
【问题讨论】:
标签: rsyslog