Filebeat在作为服务启动时不替换Windows上的环境变量

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

我正在尝试在Windows 10计算机上运行文件。

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

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 ERROR instance / 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个回答
0
投票

当filebeat作为服务启动时,用户是root用户,因此请确保您的环境变量是系统范围的

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