I know this is an old question. But lately I have to do the same too.
The problem of tail -f producer is the rotation of the log, and when the tail dies, you really don't know which lines were sent to Kafka.
Starting with nginx 1.7.1, the access_log directive can be written to syslog. See http://nginx.org/en/docs/syslog.html . We use this to log into rsyslog and with rsyslog in Kafka. http://www.rsyslog.com/doc/master/configuration/modules/omkafka.html
A little bit around - about how to do this, but in this way, no less chance of no magazines. In addition, if you use CentOS, rsyslog will always be standard.
In short, here's the setup I consider the best option for writing nginx log in kafka:
nginx → rsyslog → kafka
source share