日志服务器配置:
$EscapeControlCharactersOnReceive off
$ActionForwardDefaultTemplate RSYSLOG_ForwardFormat
$template RemoteLogs,"/rsyslog/nginx_1/nginx_access_log.%$year%-%$month%-%$day%"
local5.* ?RemoteLogs
客户端配置:
$ModLoad imfile
$InputFileName /usr/local/nginx/logs/nginx_access.log
$InputFileTag nginx_1:
$InputFileStateFile /nginx/pianyi.log
$InputFileSeverity info
$InputFileFacility local5
$InputRunFileMonitor
$InputFilePollInterval 1
$InputFilePersistStateInterval 1
$ActionQueueSaveOnShutdown on
local5.* @@192.168.204.150
本文出自 “Mask_X 博客” 博客,请务必保留此出处http://zhpfbk.blog.51cto.com/4757027/1878901
原文地址:http://zhpfbk.blog.51cto.com/4757027/1878901