【问题标题】:How to read logs from txt file using apache flume如何使用 apache flume 从 txt 文件中读取日志
【发布时间】:2017-12-20 09:31:03
【问题描述】:

我在使用 Flume 读取不断增长的 .txt 文件时遇到问题。我知道我可以使用例如从网上阅读一些东西

a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444

但是如何处理文本文件呢?我应该通过什么来代替 netcat?

【问题讨论】:

    标签: flume flume-ng


    【解决方案1】:

    好的,我已经解决了。有必要在“配置”文件中提供以下几行:

    a1.sources.r1.type = exec
    a1.sources.r1.command = tail -F /path/to/file/
    a1.sources.r1.channels = channel
    

    代替以前的,然后用这个配置文件调用flume-ng。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-12
      相关资源
      最近更新 更多