【问题标题】:Disable timestamp禁用时间戳
【发布时间】:2012-11-27 22:28:10
【问题描述】:

如何禁用时间戳(我认为是默认模板)? 我使用 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;"

谁能推荐一个模板?

【问题讨论】:

    标签: apache rsyslog


    【解决方案1】:

    在日志服务器上:

    $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
    

    在网络服务器上:

    • /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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-25
      • 2016-07-29
      • 1970-01-01
      • 2011-09-05
      • 2013-02-08
      • 2012-08-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多