fluent / fluent-bit-go

Fluent Bit Golang package to build plugins
Apache License 2.0
189 stars 52 forks source link

Is there a way to read config key with multiple times? #47

Closed bin3377 closed 2 years ago

bin3377 commented 2 years ago

For example in the in-box Prometheus Exporter output plugin, there can be more than one "add_label" in the config. Is there a way to read this kind of config with golang interface?

FLBPluginConfigKey seems only return a single string rather than an iterator or slice

PettitWesley commented 2 years ago

I think you probably have to implement some sort of special logic, like accept a string with commas as a delimitter and then split it.

bin3377 commented 2 years ago

Thanks for the reply! But it makes very hard to pass a list of objects with few fields (probably can be in a json array but ugly). Hope it can be fixed someday.