官方文档:
http://flume.apache.org/FlumeUserGuide.html#spooling-directory-source
使用spoolDirectory作为agent的source可以让flume自从监控指定的spoolDir目录,一旦有新文件生成就读取它并将它发送出去,已经读取过的文件会打上.COMPLETE后缀,不会重复发送。具体配置在官方文档中讲解得非常详细,这里列出我自己的例子,简要说明一下。
图1 用于spoolDir的agent配置文件
主要将type类型设置为spooldir,另外需要指定spoolDir的路径,如图中1和2处所示。