如何使用apache flume从txt文件中读取日志

问题描述 投票:0回答:1

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

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

但如何用文本文件做到这一点?我应该通过什么而不是netcat?

flume flume-ng
1个回答
1
投票

好的,我已经解决了这个问题。有必要在'config'文件中提供以下行:

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

而不是以前的,然后使用此配置文件调用flume-ng。

© www.soinside.com 2019 - 2024. All rights reserved.