@ruflin Reading the environment variable on startup would be sufficient for our use case.
Are these scripts within filebeat or from other sources? If they are external, is there one you suggest to use?
I would hate to go through the script route (sort of sounds like a hack) and then the functionality be added to filebeat (via a plugin or core).
@sijis There is not one recommended way as it also depends on your environment. You could use sed to replace the variables and generate the actual config file always before startup. Or you could use jinia in combination with ansible.
Golang offers a function to expand environment variables, but we didn't add it on purpose as we think this could also have unexpected side affects and would not necessarly work on all environments: https://golang.org/pkg/os/#ExpandEnv