简单部署syslog日志服务
服务
yum -y install rsyslog
vi /etc/rsyslog.conf
$ModLoad imudp
$UDPServerRun 514
# ### end of the forwarding rule ###
$template IpTemplate,"/var/log/syslog/%FROMHOST-IP%/%$year%-%$month%-%$day%.log.log"
*.* ?IpTemplate
systemctl restart rsyslog
ss -tunlp |grep 514
测试发送
logger -P 5140 -n 指定的IP地址 "这是一条测试日志"
logger -P 514 -n 192.168.11.17 "这是一条测试日志"
logger -P 514 -n 192.168.11.17 "这是一条测试日志2"