<source>
type tail
path /var/log/nginx/access.log #...or where you placed your Apache access log
pos_file /var/log/td-agent/nginx-access.log.pos
tag nginx.access #fluentd tag!
time_format %d/%b/%Y:%H:%M:%S %z
format /^(?<remote_addr>[^ ]*) - (?<remote_user>[^ ]*) \[(?<time>[^\]]*)\]\s+"(?<request_type>[^ ]*) (?<request_url>[^ ]*) (?<request_http_protocol>[^ ]*)" (?<status>[^"]*) (?<body_bytes_sent>[^ ]*) "(?<http_referer>[^"]*)" "(?<http_user_agent>[^"]*)" (?<request_time>[^ ]*)/
</source>
format /^(?<host>[^ ]*) (?<time>[^ ]*) (?<urlpath>[^ ]*) (?<size>[0-9]*) (?<duration>[0-9]*\.[0-9]*) "(?<agent>[^\"]*)"$/
types host:string,time:time,urlpath:string,size:integer,duration:float,agent:string