Skip to content

Commit 4b06c62

Browse files
committed
output: Handle plugin aliases
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
1 parent 2de7fec commit 4b06c62

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/flb_output.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <fluent-bit/flb_macros.h>
3636
#include <fluent-bit/flb_utils.h>
3737
#include <fluent-bit/flb_plugin.h>
38+
#include <fluent-bit/flb_plugin_alias.h>
3839
#include <fluent-bit/flb_plugin_proxy.h>
3940
#include <fluent-bit/flb_http_client_debug.h>
4041
#include <fluent-bit/flb_output_thread.h>
@@ -128,6 +129,7 @@ static int check_protocol(const char *prot, const char *output)
128129
{
129130
int len;
130131
char *p;
132+
const char *alias_target;
131133

132134
p = strstr(output, "://");
133135
if (p && p != output) {
@@ -146,6 +148,13 @@ static int check_protocol(const char *prot, const char *output)
146148
return 1;
147149
}
148150

151+
alias_target = flb_plugin_alias_get(FLB_PLUGIN_OUTPUT, output, len);
152+
if (alias_target != NULL &&
153+
strlen(alias_target) == (size_t) len &&
154+
strncasecmp(prot, alias_target, len) == 0) {
155+
return 1;
156+
}
157+
149158
return 0;
150159
}
151160

0 commit comments

Comments
 (0)