×

rsyslog 重新安装新系统 配置

hqy hqy 发表于2020-06-05 12:11:32 浏览2045 评论0

抢沙发发表评论

$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 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

 您阅读本篇文章共花了: 

群贤毕至

访客