LoginSignup
1
0

More than 5 years have passed since last update.

ElasticBeanstalk環境のapache access log format

Last updated at Posted at 2016-09-20

ざっくり

ElasticBeanstalk環境のapache access logはtd-agentのプリセットフォーマット(apache2)ではパースできない
下記のフォーマットでパースできる

format /^[^ ]* \((?<host>[^ ]*)\) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$/
time_format %d/%b/%Y:%H:%M:%S %z

TL;DR

/etc/httpd/conf/httpd.conf の最後の方に追加の設定があり、(%{X-Forwarded-For}i) が追加されている

#/etc/httpd/conf/httpd.conf

#### AWS Settings ####

(略)

# Add remote IP to log
LogFormat "%h (%{X-Forwarded-For}i) %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

#### End of AWS Settings ####
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0