-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
out_http: Pass tag dynamically in header #475
Conversation
Hi @edsiper Any feedback on this feature? Does it have any change to get merge or the feature is too broad/redundant? Thanks. |
plugins/out_http/http.c
Outdated
if (ctx->headertag_name) { | ||
flb_http_add_header(c, | ||
ctx->headertag_name, | ||
strlen(ctx->headertag_name), |
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.
Since ctx->headertag_name length never change, can you set it in the context to avoid strlen() every time ?
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.
@edsiper Thanks. That makes sense. let me change it and also rebase with current master to make it easier for merge.
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.
@edsiper Could you review again? I pre-compute and store in context. THanks.
4ce8c9d
to
f5b48f2
Compare
@edsiper I have fixed the code. Please see if you can bring this into next release. I think it help lots of user, especially people run fluentd in K8S will like to use HTTPS instead of TCP with SSL since it's easier to configure nginx ingress with https. Thanks you so much. I'll also prepare a doc PR into https://github.com/fluent/fluent-bit-docs |
@edsiper Hi, any signal this can be consider a feature to be merged ;). I'm very open to do any change that necessary or docs update. |
@brava-vinh sorry for the delay. Last two minor changes to get it merged:
once done we are ready to merge it. |
@edsiper Thank you. Let me make the necessary change and also rebase with current master |
6a732c4
to
25dd579
Compare
Signed-off-by: Vinh <[email protected]> The http plugin currently not sending the message's tag. The in_http plugin of Fluentd use the URI as tag. If we want to keep the original tag then we have to define multipe output section per tag to map it to URI. This change send the tag in a header(the headername can define in config file), and it's up to the receiver to parse the header and replace the tag.
25dd579
to
b4e0995
Compare
@edsiper All build are passed now. I also updated the doc: https://github.com/fluent/fluent-bit-docs/pull/55/files with an reference to how this can be used https://github.com/brava-vinh/fluent-bit-docs/blob/59b50812f1dd09a7b8ecd6d2555712082bd4301e/output/http.md I hoped to make the doc as clear as possible on why we need this, how we used it |
thanks, we are good now :) |
The http plugin currently not sending the message's tag. The in_http plugin of Fluentd use the URI as tag. If we want to keep the original tag then we have to define multipe output section per tag to map it to URI. This change send the tag in a header(the headername can define in config file), and it's up to the receiver to parse the header and replace the tag. Signed-off-by: Vinh <[email protected]>
The http plugin currently not sending the message's tag. The in_http
plugin of Fluentd use the URI as tag. If we want to keep the original
tag then we have to define multipe output section per tag to map it to
URI. This change send the tag in a header(the headername can define in
config file), and it's up to the receiver to parse the header and
replace the tag.
The use case is to use this plugin in place of SecureForward plugin
because it's easier to maintain and config terminating TLS at load balancer
level, which probably a part of infrastructure already, comparing
with maintain TLS per fluentd instance.