点击(此处)折叠或打开
-
我简单做了一个实验,syslog-ng logging server是sles11sp4, client是sles11sp3
-
-
-
1、收集日志服务器的配置
-
-
-
/etc/syslog-ng/syslog-ng.conf
-
-
-
source src {
-
udp(ip("0.0.0.0") port(514));
-
};
-
-
-
然后重新加载
-
-
/etc/init.d/syslog restart
-
-
-
-
2、客户端服务器
-
-
-
destination remote { udp("192.168.4.246" port(514)); };
-
-
log {
-
source(src);
-
destination(remote);
-
};
-
-
-
然后重新加载
-
-
/etc/init.d/syslog restart
-
-
-
-
4、测试
-
-
客户端,
-
# date;logger testing testmessage ;tail -2 /var/log/messages
-
Sat Mar 14 08:37:07 CST 2020
-
Mar 14 08:34:33 sles11sp3 root: testing testmessage
-
Mar 14 08:37:07 sles11sp3 root: testing testmessage
-
-
-
server端
-
-
sles11sp4:~ # tail -2 /var/log/messages;date
-
Mar 14 08:34:33 192.168.4.52 root: testing testmessage
-
Mar 14 08:37:07 192.168.4.52 root: testing testmessage
- Sat Mar 14 08:37:09 CST 2020