-
Notifications
You must be signed in to change notification settings - Fork 36
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
Enable multiple outputs for each input #725
Enable multiple outputs for each input #725
Conversation
Signed-off-by: constanca <[email protected]>
Signed-off-by: constanca <[email protected]>
Signed-off-by: constanca <[email protected]>
Signed-off-by: constanca <[email protected]>
Signed-off-by: constanca <[email protected]>
Signed-off-by: constanca <[email protected]>
|
||
# Let's wrap the specific output shipper in the composite one, since the composite deepcopy the mutating events | ||
shipper: CompositeShipper = CompositeShipper() | ||
|
||
if output_type == "elasticsearch": | ||
if output.type == "elasticsearch": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to either keep output.type or output_destination common in the whole doc
So output.type to become output.destination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
output.destination
is the URL - either the cloud url or ES url. output.type
can only be elasticsearch
or logstash
, they are different things @gizas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I had the impression that output.destination does not exist. Thanks for clarification
So destination should become output_url in general to denote the actual info of the variabble. But nw not important
|
||
if output_type in self._outputs: | ||
raise ValueError(f"Duplicated `type` {output_type}") | ||
if output_type not in _available_output_types: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here to chaneg type with destination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as before, output.type
can only be elasticsearch or logstash, we use it to create the shipper, not the same as the destination
elif output_type == "logstash": | ||
if "logstash_url" not in kwargs: | ||
raise ValueError(f"Output type {output_type} requires logstash_url to be set") | ||
output_dest = kwargs["logstash_url"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gizas You can see in this line how the output destination is initiated
What does this PR do?
Each input can now have multiple outputs of the same
type
. It cannot, however, have the same output specified more than once for each input - that is, it cannot have twoelasticsearch
outputs with the same destination. See section Results for examples.Why is it important?
See details on #721.
Checklist
CHANGELOG.md
How to test this PR locally
Refer to https://github.com/elastic/elastic-serverless-forwarder/tree/main/how-to-test-locally.
Related issues
Relates to #721
Results
Example 1: Trying 2
elasticsearch
outputsI have an input with two
elasticsearch
outputs:I sent a log event from this input.
If I look at Discover in both clouds, I can see that both outputs got my message:
https://terraform-8b3bac.es.eu-central-1.aws.cloud.es.io:
https://terraform-2.es.europe-west4.gcp.elastic-cloud.com:
Example 2: Trying 2
elasticsearch
outputs with the same destinationI have an input with two
elasticsearch
outputs that are the same:This case fails, since we cannot have duplicated outputs (that is, output with the same destination for the same input):
Example 3: Checking message body in replay queue
The message body caused by an ingestion error should contain the
output_destination
(instead ofoutput_type
like before). I am causing the placement of the message in the replay queue by using wrong authentication:Message in the replay queue: