How to read logs from file in kafka?

孤者浪人 提交于 2019-12-13 09:02:53

问题


I want to read Apache logs in kafka and then further process in to Spark Streaming.I am new to kafka. As far as I have understand I have to write a producer class to read logs file.


回答1:


You can do so by creating a connector which sources each line of the log file into the Kafka topic. Check out the example here:

https://docs.confluent.io/current/connect/devguide.html#connect-developing-simple-connector



来源:https://stackoverflow.com/questions/46508901/how-to-read-logs-from-file-in-kafka

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!