I've read up a lot of the various posts on this topic but cannot seem to find something specific to my particular issue.
I've got filebeat running on centos as a service with systemd as per the docs. I'm using a dropin file to add some environment variables in filebeat's config (
filebeat.yml). Filebeat starts no problem. However, when I try to run the
filebeat setup -e command I get the dreaded
Exiting: error unpacking config data: Can not find FOO environment variable accessing 'fields.env' (source:'/etc/filebeat/filebeat.yml')
I've found that I can run setup with an environment variable if I set it by adding it to somewhere like
/etc/profile.d/var-script.sh. Then restart filebeat (
sudo systemctl restart filebeat) and then run the setup with
sudo -E filebeat setup -e but this feels odd to have to add it in the system dropin file for running filebeat and a second location for the setup command.
- I can add systemd environment variables and filebeat will start properly
- The setup command does not seem to be able to find these variables
Any ideas what i'm doing wrong?