我在项目目录中没有以下yml文件,而不是全局文件beat配置目录中:

filebeat:
  idle_timeout: 5s
  prospectors:
    paths:
      - "data-log/*"

output:
  elasticsearch:
    hosts: ["localhost:9200"]

运行filebeat -configtest不产生任何输出。
运行filebeat也不产生任何输出。

我希望正在运行的filebeat守护程序从该目录中动态获取配置,假设命令filebeat应该这样做。我知道可以在全局配置文件中进行设置,但是我宁愿动态地执行此操作。

我在做什么错或者这里暗示的假设是错误的?

最佳答案

尝试跟踪文件拍过程strace -fp {pid} -s 1024,您应该查找的行是stat({file_name}
这样,您将看到filebeat是否可以正确解析路径。

关于elasticsearch - 如何使filebeat拾取项目特定的配置文件,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37756864/

10-13 07:45