05
2020
06

rsyslog 重新安装新系统 配置



推荐点击下面图片,通过本站淘宝优惠价购买:

image.png

$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://hqyman.cn/post/1357.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下,本站随机推荐观看栏目:


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: