$template RemoteLogs,"/var/log/%fromhost-ip%/%fromhost-ip%.log"
*.* ?RemoteLogs
#:FROMHOST-IP, isequal, "172.16.254.2" /var/log/172.16.254.2.log
#:FROMHOST-IP, isequal, "10.11.0.253" /var/log/10.11.0.253.log
& ~
#$template DynFile,"/var/log/system-%fromhost-ip%.log"
#$template DynaFile,”/var/log/%fromhost-ip%.log”
#*.* -?DynaFile
#& ~
#if $fromhost-ip startswith '172.16.254.2' then /var/log/network1.log
#& ~
#if $fromhost-ip startswith '10.11.0.253' then /var/log/network2.log
#& ~
#*.* /var/log/syslog.log
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="enp2s0"
UUID="152bac80-0be0-49aa-9fd2-4a4f1a200c70"
DEVICE="enp2s0"
ONBOOT="yes"
IPADDR=192.168.170.28
PREFIX=22
GATEWAY=192.168.170.1
ZONE=public
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="enp2s0"
UUID="58741c07-c281-416d-a061-404cf2d8bed3"
DEVICE="enp2s0"
ONBOOT="yes"
IPADDR=192.168.170.29
PREFIX=22
GATEWAY=192.168.170.1
ZONE=public
$OMFileIOBufferSize 768k
$OMFileAsyncWriting on
$OMFileFlushOnTXEnd off
$OMFileFlushInterval 3
$MainMsgQueueSize 100000
#### GLOBAL DIRECTIVES ####
if ($fromhost-ip=='172.16.254.2') then /var/log/172.16.254.2.log
&~
if ($fromhost-ip=='10.11.0.253') then /var/log/10.11.0.253.log
&~
if ($fromhost-ip=='172.16.254.2') then /var/log/360fw/172.16.254.2.log
& stop
if ($fromhost-ip=='10.11.0.253') then /var/log/sslvpn/10.11.0.253.log
& stop
if $fromhost-ip startswith '192.168.254.' then /var/log/officesw/$fromhost-ip$.log
& stop
systemctl stop NetworkManager
systemctl disable NetworkManager
systemctl restart network
systemctl enable rsyslog
systemctl restart rsyslog
firewall-cmd --zone=public --add-port=514/udp --permanent
firewall-cmd --reload
本文链接:https://www.kinber.cn/post/1357.html 转载需授权!
推荐本站淘宝优惠价购买喜欢的宝贝: