-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when combining processors autodiscover hint with modules using processors #16190
Comments
Found the issue is in go-ucfg in how it handles merging configurations. elastic/go-ucfg#150 |
Actually looking at it, its not an issue in go-ucfg. Its an issue of the code path relying on the default behavior in go-ucfg when really |
Actually changing to just Autodiscover is doing just blind merging of configuration without using a structure to provide context on how the merging should be performed. Example the following structure would fix the bug (only showing the case for
Looking into how hard it would be to change Autodiscover to use structs in cases where the merging behavior needs to be adjusted. |
I guess this could be a mix of well known fields where we decide how merge happens and a default behavior for the rest? |
I've never tried if this works, but I think we might be able to provide some generic structs allowing us to control merging rules like. In case it doesn't work I'd say this is a bug in go-ucfg. For example we could create definitions like this:
At least for hints based auto-discovery we can setup one 'merger' per hint and then apply one after another. This allows us to define the merge behavior per hint. E.g. for processors we might prefer append, but for hosts or paths we would prefer Replace. |
Yeah the more I dig into this, more things are wrong. Example is
|
@urso Whats your thoughts on extending go-ucfg to adjust config handling options per field in Example:
Could be extended even to do nested fields:
Another option is just to do this in beats with something like:
|
Tried the second option as I thought it was the simplest but it does not work because the final Probably the first approach is more appropriate as its not hacking the usage of |
Option 1 would be feasible to do in go-ucfg. Yet we would introduce more magic strings in Beats, hoping that we did catch every single use-case. I'd prefer if we would not have config naming all over the place, but this might reqiure us to introduce a schema long term. Instead of:
it could be:
Not sure we want/need full path matching. When merging we might not always know the 'level' of the setting. E.g. if an array of configs are given, then the |
The idea of The array of configs case would be handled by The idea for glob pattern is good, I was only thinking that
|
Better yet if we go with the
I feel like I am still leaning towards magic strings as all the logic could really be distilled down into them simply. We could add the function way as another possible path, if we need even more complexity (but that is not know). Questionable if we even need the |
It seems autodiscover
processors
hint produces an error when used with modules that also make use of processors (ie elasticsearch module).Steps to reproduce it:
Configure Filebeat with hints based autodiscover like this:
Launch a container with the following labels:
This error happens:
The expected behavior is to get the module launched, with both processors working for it.
The text was updated successfully, but these errors were encountered: