Skip to content

Instantly share code, notes, and snippets.

@matsumana
Created November 15, 2012 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsumana/4078174 to your computer and use it in GitHub Desktop.
Save matsumana/4078174 to your computer and use it in GitHub Desktop.
FluentdのWebサーバ用設定ファイル
<source>
type tail
path /var/log/httpd/access_log
pos_file /var/lib/fluent/access_log.pos
# apacheのログフォーマットは以下 (デフォルトの末尾に%Dを付けただけ)
# LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined
format /^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<status>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)" (?<response>[^ ]*))?$/
time_format %d/%b/%Y:%H:%M:%S %z
tag apache.access.host01
</source>
<match apache.access.**>
type forward
<server>
host fluent00
</server>
buffer_type file
buffer_path /var/log/fluent/apache-forward
retry_limit 9
flush_interval 1s
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment