Thibaud
Thibaud

Reputation: 35

Filebeat not replacing environment variable on windows when started as a service

I'm trying to have a filebeat running on a Windows 10 machine.

In my configuration I have some environment variables like:

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

Everything works fine when I start filebeat through the command line with: filebeat.exe -e -v. But when I start as a service with: Start-Service filebeat I have the following error in my logs:

2018-07-16T16:57:19.545+0200 ERROR instance/beat.go:691 Exiting: Error in initing input: missing field accessing 'filebeat.inputs.0.paths.0' (source:'C:\Program Files\Filebeat\filebeat.yml')

I tried with single, double or no quotes at all.

It might be a possible duplicate of this question : Environment Variable replacement in Logstash when running as a service in Ubuntu

Thanks for your help!

Upvotes: 0

Views: 1024

Answers (1)

Thibaud
Thibaud

Reputation: 35

When filebeat is started as a service, the user is root, so make sure your environment variables are system-wide

Upvotes: 0

Related Questions