Skip to content

Instantly share code, notes, and snippets.

@oranie
Created March 16, 2012 15:35
Show Gist options
  • Save oranie/2050577 to your computer and use it in GitHub Desktop.
Save oranie/2050577 to your computer and use it in GitHub Desktop.
fluentd_apache_log_parse
<source>
type tail
#LogFormat "%{X-Forwarded-For}i %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined
format /^(?<XFF-host>[^ ]*) (?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<status>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)" (?<response_time>[^ ]*))?$/
time_format %d/%b/%Y:%H:%M:%S %z
path /var/log/httpd/access_log_sym
tag apache.access
pos_file /var/log/td-agent/tmp/access.log.pos
</source>
<match *.**>
type forward
#standby yes
<server>
name aggregate
host 192.168.1.1
port 24224
weight 60
</server>
buffer_type file
buffer_path /var/log/td-agent/myapp-forward
retry_limit 50
flush_interval 1s
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment