/etc/rsyslog.conf

 

$ModLoad imfile                                加在imfile模块

$InputFileName           filePath          监测日志路径

$InputFilePollInterval      10               轮询时间

$InputFileTag                  标签            监测日志的标签

$InputFileStateFile        filePath         定义记录偏移量数据文件名

$InputFileSeverity           info             需要发送日志等级

$InputFileFacility         local0             设备名称

$InputRunFileMonitor                         以示生效

*.info;mail.none;authpriv.none;cron.none;local0.none;   /var/logmessages    将该设备不写入本地/var/log/messages,避免占用空间

 

local0.none                                   @@ip:port                      接收方的ip和端口,@@为TCP,@为UDP

接收方存储路径配置

if $programname contains 'tagFilePath'  then -/varlog/remote_log/tagFilePath.log

相关文章:

  • 2022-12-23
  • 2021-11-21
  • 2021-11-06
  • 2021-11-04
猜你喜欢
  • 2021-07-15
  • 2021-05-07
  • 2021-12-15
  • 2021-10-09
  • 2022-01-10
  • 2021-05-25
相关资源
相似解决方案