-
One of the main reasons for the "schema" of Fluent Bit configuration is simplicity, by forcing the user to have a fixed indentation and avoiding sub-levels of nested elements. There is no "perfect" configuration schema, all of them have pros and cons, and personally, I think we should focus on how to bring a good end-user experience. What works for us as a project, might not work for others. The intention of this open discussion is to share the current context and challenges to extend Fluent Bit capabilities from a config file perspective. Disclaimer: this is not about if we should move to Yaml, TOML, or another type of schema (despite we consider we should have some compatibility or translation from those). Current Schemaref: https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/classic-mode/format-schema We have 3 main concepts: sections and key/value pairs.
Example:
Extension needsThere are cases where inside a section were would be ideal to have multiple "logical contexts", e.g:
at this point, the config get's hard to read. In addition, the plugin developer must implement the logic to parse dynamic keys that start with Proposal for extensionI'd like to propose the concept of To split the context I propose to use a simple separator prefix followed by a name, e.g:
by using that approach the configuration explained above will be represented as:
Also, we might consider indentation inside the group too:
Groups might be optional for the plugin that needs that kind of more complex configuration. Open for CommentsI would like to get your input on this proposal, again, this is about extending the current format and not switching to another one (it's not the time for that) |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 11 replies
-
Seems a reasonable shout to me, I'm thinking it might help with reviewing diffs. We would need to report config errors for the group which looks to be similar to an alias. Do they have to be unique just in the section? I hope so rather than unique for the whole file once you start using includes. Presumably you can just @include groups? Say you had a common one across sections that would be useful. Maybe the existing square brackets and indentation rather than a new format? |
Beta Was this translation helpful? Give feedback.
-
https://docs.fluentbit.io/manual/administration/security |
Beta Was this translation helpful? Give feedback.
-
Having had a bit of time to reflect on this, I'm not sure extending what is a slightly bespoke format is the right way to go. Now I know we're not suggesting changing the format entirely but in my opinion it is something worth considering: rather than putting the effort in to extend the current schema would it be better to adopt a schema that already has the concepts we need along with a full ecosystem? Playing devil's advocate, if we had a common format like YAML or JSON as input then there are also a load of validation tools available for almost everyone to use. To maintain backwards compatibility we can have a legacy processing stage that converts the current config into the new one then consumes it: there are precedents already for this approach, e.g. YAML is converted into JSON for REST API calls. The effort spent on extending, testing and maintaining the current schema could then be redirected into the conversion process. I guess my main point is that changing the config might be a better option all round so we should not discount it out of hand. I'm not sure what the killer feature is we currently need, if it's plugin development then there are a myriad of tools to deal with YAML, JSON, a.n.other language lookup in C, Go, etc. Adding this syntax and keeping the dot notation would be confusing, I agree with @nokute78 on this. I think you should pick one and maybe allow aliases or similar for backwards compatibility but only for existing options. The goal being to migrate to a common syntax. |
Beta Was this translation helpful? Give feedback.
-
This is just my two cents but I'm one of the wondering how to extends Fluent Bit configuration format people. Similar to Fluentd configuration style, it would be nice to handle TOML like format that uses indentations for representing groups on Fluent Bit configuration file. [INPUT]
name something
[INPUT.abc]
type abc
eval def
check true
[INPUT.ttt]
type ttt
eval ghi
[INPUT.DB]
path /path/to/sqlitedb
# Default rule needn't to use section notation, just use default level of indentations.
check false |
Beta Was this translation helpful? Give feedback.
-
FYI: A new |
Beta Was this translation helpful? Give feedback.
-
This has been implemented in v1.9. |
Beta Was this translation helpful? Give feedback.
This has been implemented in v1.9.