现在要求:
把 A、B 机器中的 access.log、nginx.log、web.log 采集汇总到 C 机器上
然后统一收集到 hdfs 中。
但是在 hdfs 中要求的目录为:
/source/logs/access/20190101/**
/source/logs/nginx/20190101/**
/source/logs/web/20190101/**
① 在服务器 A 和服务器 B 上 创建配置文件 exec_source_avro_sink.conf
# Name the components on this agent
a1.sources = r1 r2 r3 a1.sinks = k1 a1.channels = c1
# Describe/configure the source
a1.sources.r1.type = exec a1.sources.r1.command = tail -F /root/data/access.log a1.sources.r1.interceptors = i1 a1.sources.r1.interceptors.i1.type = static ## static 拦截器的功能就是往采集到的数据的 header 中插入自 ## 己定义的 key-value 对 a1.sources.r1.interceptors.i1.key = type a1.sources.r1.interceptors.i1.value = access
a1.sources.r2.type = exec
a1.sources.r2.command = tail -F /root/data/nginx.log
a1.sources.r2.interceptors