在Windows上的Flume中通过控制台监视文件

发布于 2025-02-03 01:30:37 字数 1026 浏览 2 评论 0原文

我正试图将Windows上的Flume用作课堂作业,我首先在Ubuntu上进行了练习,但没有任何问题。 在Windows上,我已经安装了Coreutils在Windows上使用Linux命令。 代理可以运行,但陷入了EXEC源,然后检查执行文件是否已更新。 我使用以下代码: 它正在显示c:/logs/log..txt中的文件的内容,并在CMD中显示。

Ag_Monitor.sources = s1
Ag_Monitor.sinks = k1
Ag_Monitor.channels = c1

Ag_Monitor.sources.s1.type = exec
Ag_Monitor.sources.s1.command = tail -F C:\logs\log.txt
Ag_Monitor.sources.s1.shell = cmd.exe /c

Ag_Monitor.sources.s1.channels = c1

Ag_Monitor.sinks.k1.type = logger 

Ag_Monitor.sinks.k1.channel = c1

Ag_Monitor.channels.c1.type = memory

除了执行尾部命令外,我还上传了问题的图像,因为它指示了另一个目录。

我使用PowerShell修改了文件: get -content c:\ logs \ log.txt -tail 10 powershell.exe /c

我有以下结果: 执行得很好,但没有出现在屏幕上。

I'm trying to use flume on Windows as a class assignment, I did the exercise first on Ubuntu and I didn't have any problems.
On windows I have installed coreutils to use linux commands on windows.
The agent gets to run but gets stuck at Exec source started and then checks to see if the execute file has been updated.
I use the following code:
It is displaying the content of a file inside C:/logs/log.txt and displays it in cmd.

Ag_Monitor.sources = s1
Ag_Monitor.sinks = k1
Ag_Monitor.channels = c1

Ag_Monitor.sources.s1.type = exec
Ag_Monitor.sources.s1.command = tail -F C:\logs\log.txt
Ag_Monitor.sources.s1.shell = cmd.exe /c

Ag_Monitor.sources.s1.channels = c1

Ag_Monitor.sinks.k1.type = logger 

Ag_Monitor.sinks.k1.channel = c1

Ag_Monitor.channels.c1.type = memory

I upload an image of the problem in addition to executing the tail command incorrectly since it indicates another directory.
enter image description here

I have used powershell modifying the file with :
Get-Content C:\logs\log.txt -Tail 10
powershell.exe /c

I have the following result:
has executed it well but it does not appear on the screen.
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文