File Beat 无法从特定文件夹发送日志,这是应用程序日志文件夹。
已经尝试过的事情:
- 在 kafka 中创建了一个新主题以重新测试设置。
- 检查文件夹和要发送的文件的文件权限。
- 将文件节拍从 5.5 更新到 6.7
- 从 filebeat.prospector 更改为 filebeat.inputs
运行配置:
filebeat.inputs:
- type: log
paths:
- /var/log/containers/*.log
fields_under_root: true
output.kafka:
hosts: ["10.0.0.0:9092"]
topic: "testtopic"
codec.json:
pretty: true
有了这个,我可以看到“testtopic”中的所有日志
未运行配置:
filebeat.inputs:
- type: log
paths:
- /app/log/server/*.log
fields_under_root: true
output.kafka:
hosts: ["10.0.0.0:9092"]
topic: "testtopic"
codec.json:
pretty: true
预期结果:来自路径 /app/log/server/*.log 的日志应发送到 Kafka