How to optimize config-files of filebeat for many different environments?

We have 3 different config files for 3 envs on the project. Each env is a separate cluster. All config files are similar to each other but the one difference - field.env, which is related to environment, accordingly.
image
Thats why now we have a lot of value files for each env.
image
How can we optimize this? Maybe somehow leave only one value file, and override it through the helm task from external variable groups? If it possible?
Thanks

You may use environment variables in your configuration files.

This is how I did a couple of years ago, had something like this:

fields:
    env: "${HOST_ENV}"
    dc: "${HOST_DC}"

Then each host running filbeat had those two environment variables, in windows hosts they where set as global environment variables and in linux hosts I had a /etc/filebeat/env file and a override.conf pointing to this file in the systemd service.

2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.