rsyslogがアウトバウンドログデータに不要なテキストを追加します。

rsyslogがアウトバウンドログデータに不要なテキストを追加します。

rsyslogを使用してアクセスおよびエラーログデータをリモートサーバーに送信しています。インターフェイスは所定の位置にあるが、アウトバウンドログデータから/var/log/http/access_log

これはaccess_logエントリの一部です。 1.1.1.1は私のIPアドレスで、99.99.99.99はアプリケーションサーバーのIPです。

1.1.1.1 99.99.99.99 - - [2015年6月29日:11:57:58 -0400] "GET /somepage.php HTTP/1.1" 200 443 20


tcpdump -vv -s 0 -A dst port 514rsyslogは、アプリサーバー(トランスポートシステム)から送信された対応するアウトバウンドログデータを使用します。

<173>6月29日 11:57:58 アプリケーションサーバーエンコーダ: 1.1.1.1 99.99.99.99 - - [29/Jun/2015:11:57:58 -0400] "GET /somepage.php HTTP/1.1" 200443 20

アウトバウンドログデータの最初の数段落を削除するには?具体的には:

Jun 29 11:57:58 appserver acoder: 

送信された唯一のコンテンツが上記の最初の引用符で示されているaccess_logにあるように、その文字列を削除したいと思います。

httpd.conf

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
# LogLevel warn
LogLevel debug

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).

LogFormat "%h %A %l %u %t \"%r\" %>s %p %b" combined
LogFormat "%h %A %l %u %t \"%r\" %>s %p %b" common

LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

rsyslog.conf

# rsyslog v5 configuration file

# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html

#### MODULES ####

$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imklog   # provides kernel logging support (previously done by rklogd)

#### GLOBAL DIRECTIVES ####

# Use default timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

# Include all config files in /etc/rsyslog.d/
$IncludeConfig /etc/rsyslog.d/*.conf


#### RULES ####

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none                /var/log/messages

# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure

# Log all the mail messages in one place.
mail.*                                                  -/var/log/maillog

# Log cron stuff
cron.*                                                  /var/log/cron

# Everybody gets emergency messages
*.emerg                                                 *

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler

# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log

# ### begin forwarding rule ###
# The statement between the begin ... end define a SINGLE forwarding
# rule. They belong together, do NOT split them. If you create multiple
# forwarding rules, duplicate the whole block!
# Remote Logging (we use TCP for reliable delivery)
#
# An on-disk queue is created for this action. If the remote host is
# down, messages are spooled to disk and sent when it is up again.

local5.*;local6.* @syslog.my.organization.tld:514

# ### end of the forwarding rule ###

ベストアンサー1

削除する部分は、rsyslog送信者ではなく受信デーモンによって作成されたものであるため、削除できません。彼らはrsyslog

おすすめ記事