如何禁用时间戳(我认为是默认模板)?
我使用rsyslog发送Apache access.log
但我不想要rsyslog时间戳...
Nov 26 14:13:21 remotehost apache: 1.2.3.4 - user [26/Nov/2012:14:13:21 +0100] "GET /index.php HTTP/1.1" 200 2430 "https://1.2.3.4" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1;"
有人可以建议模板吗?
答案 0 :(得分:0)
$ModLoad imudp
$UDPServerAddress 1.1.1.1
$UDPServerRun 514
$AllowedSender UDP, 1.1.1.2
$template MsgFormat,"%msg%\n"
$template ApacheRemoteCustom,"/var/log/manager/access.log"
if $syslogfacility-text == 'local6' and $programname == 'apache' then -?ApacheRemoteCustom;MsgFormat
Web服务器上的/etc/apache2/apache2.conf中 CustomLog“| / usr / bin / tee -a /var/log/apache2/access.log | / usr / bin / logger -t apache -p local6.notice”合并env =!dontlog
/etc/rsyslog.d/40-apacheaccess.conf local6.notice @ 1.1.1.1