rsyslog 测试(rsyslog 必须yum 安装uat-web02:/root# rpm -qa | grep rsyslog
rsyslog-8.21.0-1.el6.x86_64)
//读取单个文件测试:
客户端发送:
uat-web02:/var/log/nginx# echo "zjzc-111222333444qwe" >>scan.log
uat-web02:/var/log/nginx#
服务端接收:
zjtest7-frontend:/data/scan# tail -f scan.2016-09-26
scan-aaaaaaaaaaaaa
bbbbb21231
scan-bbbbb21231
scan-cccc21231
scan-dddd9999
eeeeeeeeee3131
eeeeeeeeee3131
eeeeeeeeee3131
321dadada--scan
test scan9999
zjzc-111222333444qwe
客户端重启rsyslog:
uat-web02:/root# service rsyslog stop
Shutting down system logger: [ OK ]
uat-web02:/root# ps -ef | grep rsyslog
root 722 32322 0 10:02 pts/2 00:00:00 grep rsyslog
uat-web02:/root# service rsyslog start
Starting system logger: [ OK ]
uat-web02:/root# ps -ef | grep rsyslog
root 733 1 0 10:02 ? 00:00:00 /sbin/rsyslogd -i /var/run/syslogd.pid
root 748 32322 0 10:02 pts/2 00:00:00 grep rsyslog
uat-web02:/root#
此时服务端不会接收重复日志:
zjtest7-frontend:/data/scan# tail -f scan.2016-09-26
scan-aaaaaaaaaaaaa
bbbbb21231
scan-bbbbb21231
scan-cccc21231
scan-dddd9999
eeeeeeeeee3131
eeeeeeeeee3131
eeeeeeeeee3131
321dadada--scan
test scan9999
zjzc-111222333444qwe