You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, each input needs to have defined one output (see an example of the configuration file here).
However, this is not convenient. If a user wants to use the same output for 4 inputs, they have to define it 4 times. And if they want to change it later, they have to do it another 4 times, when we could place them as a shared output.
There are also two issues (1 and 2) requesting the possibility to have more than one output defined for input. At this moment, this is not possible, unless the output type is different. Current options are:
Additionally, and since in the code,each input is uniquely identified by its id (see this function), I also do not think it is possible to configure the same input to have multiple outputs at all, even if specified in double.
To further clarify this change, let's consider this example: I want to:
Have two inputs, each for corresponding to one cloudwatch logs group. Both should send data to the same ES.
Have two outputs for one of the two cloudwatch logs group.
I defined a list under outputs that will be the shared output. The shared outputs should have a field id to simplify their reference in case the user wants to have multiple shared outputs, but not apply them all to inputs.
I can add more outputs under inputs[*].outputs list.
Enhancement
Currently, each input needs to have defined one output (see an example of the configuration file here).
However, this is not convenient. If a user wants to use the same output for 4 inputs, they have to define it 4 times. And if they want to change it later, they have to do it another 4 times, when we could place them as a shared output.
There are also two issues (1 and 2) requesting the possibility to have more than one output defined for input. At this moment, this is not possible, unless the output type is different. Current options are:
elastic-serverless-forwarder/share/config.py
Line 15 in acbe702
The outputs for each input are saved in a dictionary:
elastic-serverless-forwarder/share/config.py
Line 294 in acbe702
However, this dictionary is using the type as the key, so if we try to add a new output with the same type, it will fail:
elastic-serverless-forwarder/share/config.py
Lines 421 to 430 in acbe702
Additionally, and since in the code,each input is uniquely identified by its id (see this function), I also do not think it is possible to configure the same input to have multiple outputs at all, even if specified in double.
To further clarify this change, let's consider this example: I want to:
For this, the best we can do is:
So I had to define the same output twice, and I fail at achieving my goal 2., since it is not possible.
With this enhancement I could refactor the
config.yaml
file to look like this:Explanation:
outputs
that will be the shared output. The shared outputs should have a fieldid
to simplify their reference in case the user wants to have multiple shared outputs, but not apply them all to inputs.inputs[*].outputs
list.To completion
The code needs to be changed.
The configuration file is parsed here:
elastic-serverless-forwarder/handlers/aws/handler.py
Line 72 in acbe702
Inside this function we iterate over the outputs:
elastic-serverless-forwarder/share/config.py
Line 572 in acbe702
We need to change this function to allow more than one output.
These outputs are then reference here:
elastic-serverless-forwarder/handlers/aws/handler.py
Line 173 in acbe702
Note:
event_input
contains our outputs.This
composite_shipper
gets our outputs, and later uses it when calling (this is just one reference of usage):elastic-serverless-forwarder/handlers/aws/handler.py
Line 195 in acbe702
After this change, the documentation here needs, of course, to be updated.
PRs
The text was updated successfully, but these errors were encountered: