syslog服务器
1、#开启远程UDP模块
sed -ri "s/^#(.*imudp)/\1/" /etc/rsyslog.conf
sed -ri "s/^#(.*UDPServerRun 514)/\1/" /etc/rsyslog.conf
2、#开启远程TCP模块
sed -ri "s/^#(.*imtcp)/\1/" /etc/rsyslog.conf
sed -ri "s/^#(.*InputTCPServerRun 514)/\1/" /etc/rsyslog.conf
配置日志目录
vim /etc/rsyslog.conf
在最下面添加两行
$template Remote,"/data/log/%fromhost-ip%/%fromhost-ip%_%$YEAR%-%$MONTH%-%$DAY%.log"