filebeat和flume都是当下非常流行的日志采集工具,flume功能更强,使用范围也更广,而filebeat相比flume更加轻量,一般跟ELK一起使用。
笔者在使用这两个工具对接kafka的过程中发现他们采集到kafka里的数据格式是不同的,这里我使用spark streaming分别消费出几条数据对比一下:
spark streaming程序:
def run():Unit={
val sparkConf=new SparkConf().setAppName("Test").setMaster("local[*]")
val ssc=new StreamingContext(sparkConf,Seconds(10