-
Notifications
You must be signed in to change notification settings - Fork 1
Description
It would be useful to expose OS information (e.g. type of OS - Linux/Windows/macOS), EC2 metadata, etc. as environment variables for configuration to use, in a similar way to how we always expose HOSTNAME as a variable to use: https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/yaml/environment-variables-section#external-variables
Either we can do this as a specific custom plugin or via the same mechanism as HOSTNAME so it can be reused for all configuration options as a simple variable.
For example, you could do this in the git_config plugin like so (assuming HOST_TYPE is set to something like Linux/Windows/etc.):
customs:
- name: git_config
repo: https://github.com/myorg/fluent-bit-configs.git
ref: main
path: ${HOST_TYPE}/fluent-bit.yaml
clone_path: /tmp/fluentbit-git
poll_interval: 60This will load the fluent-bit.yaml file under each specific directory for the HOST_TYPE variable, e.g. Linux/fluent-bit.yaml, Windows/fluent-bit.yaml, etc.
The less effort required to get this information the better to prevent people needing to modify anything else.