I'm on version 4.0.3. I want to try yaml based con...
# fluent-bit
r
I'm on version 4.0.3. I want to try yaml based configuration. How can I set the default config to yaml file /etc/fluent-bit.yaml instead of /etc/fluent-bit.conf
l
what do you mean default config? the service? if it's that, then you can change your service conf
r
Yes the service section of config. In my path I have both fluent-bit.conf and fluent-bit.yaml. I want fluent bit to pick the yaml file. For which I'm passing the yaml file in config-path argument
When I do this, it runs into error saying check config is valid in classic format. When I checked the code this seems to be thrown from fluent-bit in flb_cf_fluentbit.c. this code path shows fluent bit treating the yaml file as a conf file
I want to know how I can pass the fluent bit config in yaml format
p
That should work fine and is exactly how I do it
I think you need to provide more details
Are you using official packages or building from source? What are you actually running?
If you build from source you need to ensure you have libyaml dependencies present
For example, I used YAML here with the containers: https://www.fluent.do/blog/otel-collector-integration
Copy code
docker run --rm -it -v $PWD/fluent-bit.yaml:/fluent-bit/etc/fluent-bit.yaml:ro fluent/fluent-bit -c /fluent-bit/etc/fluent-bit.yaml
This mounts in a local fluent-bit.yaml file and uses it by passing it on the command line.