【问题标题】:Filebeat not replacing environment variable on windows when started as a serviceFilebeat 在作为服务启动时不会替换 Windows 上的环境变量
【发布时间】:2018-07-16 23:31:30
【问题描述】:

我正在尝试在 Windows 10 机器上运行 filebeat。

在我的配置中,我有一些环境变量,例如:

filebeat.inputs:
- type: log
  enable: true
  paths:
    - '${My_Env_Variable}\logs\data.log*'

当我通过命令行启动 filebeat 时,一切正常:filebeat.exe -e -v。但是当我作为服务开始时:Start-Service filebeat 我的日志中有以下错误:

2018-07-16T16:57:19.545+0200 错误实例/beat.go:691 退出:初始化输入时出错:缺少访问“filebeat.inputs.0.paths.0”的字段(来源:“C:\ Program Files\Filebeat\filebeat.yml')

我尝试过使用单引号、双引号或根本不使用引号。

这可能是这个问题的重复:Environment Variable replacement in Logstash when running as a service in Ubuntu

感谢您的帮助!

【问题讨论】:

    标签: windows filebeat


    【解决方案1】:

    当filebeat作为服务启动时,用户是root,所以确保你的环境变量是系统范围的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-08
      • 1970-01-01
      • 2018-07-19
      • 1970-01-01
      • 2018-12-02
      • 2014-06-17
      相关资源
      最近更新 更多