码迷,mamicode.com
首页 > 其他好文 > 详细

rsysylog以文件的形式收录终端的日志信息

时间:2019-08-30 22:51:45      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:serve   span   state   收录   include   color   template   sage   cti   

 

 

$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imjournal # provides access to the systemd journal
$ModLoad imudp
$UDPServerRun 514
$template DynaFile,"/var/log/%FROMHOST-IP%/%syslogfacility-text%.log"  #收集的日志格式1
*.* -?DynaFile

  #$template IpTemplate,"/var/log/%FROMHOST-IP%.log"  #收集日志格式2
  #*.* ?IpTemplate
  #& ~


$WorkDirectory /var/lib/rsyslog
$template CustomFormat,"%$NOW% %TIMESTAMP:8:15% %HOSTNAME% %syslogtag% %msg%\n"  #修改时间格式
$ActionFileDefaultTemplate CustomFormat
$IncludeConfig /etc/rsyslog.d/*.conf
$OmitLocalLogging on
$IMJournalStateFile imjournal.state
*.info;mail.none;authpriv.none;cron.none                /var/log/messages
authpriv.*                                              /var/log/secure
mail.*                                                  -/var/log/maillog
cron.*                                                  /var/log/cron
*.emerg                                                 :omusrmsg:*
uucp,news.crit                                          /var/log/spooler
local7.*                                                /var/log/boot.log

 

客户端:

info-center channel 7 name sw1
info
-center loghost 1.1.1.1 channel sw1 info-center loghost 1.1.1.1 source-ip 2.2.2.2 channel sw1

 

rsysylog以文件的形式收录终端的日志信息

标签:serve   span   state   收录   include   color   template   sage   cti   

原文地址:https://www.cnblogs.com/dengcongcong/p/11437293.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!