fluent/fluentd — pull request #82 by baepiff (2012-11-26 22:28:10+00:00)
Title: Could you add hostname option to in_tail.rb ?

Configuration :

type tail
format /^(?[^ ]*) (?[^ ]*) (?[^ ]*) \[(?[^\]]*)\] "(?\S+)(?: +(?[^ ]*) +\S*)?" (?[^ ]*) (?[^ ]*)(?: "(?[^\"]*)" "(?[^\"]*)" "(?[^\"]*)" (?[^ ]*))?$/
path /usr/local/nginx/logs/access.log
pos_file /var/log/td-agent/access.log.pos
time_format %d/%b/%Y:%H:%M:%S %z
tag hostname.in.tail
hostname_command hostname

Result :

2012-11-27T00:00:43+09:00 hostname.in.tail {"hostname":"myhost","remote":"172.28.32.249","host":"-","user":"-","method":"GET","path":"/monitor","code":"200","size":"15","referer":"-","agent":"-","forward":"-","response_time":"0.003"}