diff --git a/plugins/out_loki/loki.c b/plugins/out_loki/loki.c index d93a3f9aad6..b10a4f1d306 100644 --- a/plugins/out_loki/loki.c +++ b/plugins/out_loki/loki.c @@ -1578,7 +1578,7 @@ static void cb_loki_flush(struct flb_event_chunk *event_chunk, } /* Create HTTP client context */ - c = flb_http_client(u_conn, FLB_HTTP_POST, FLB_LOKI_URI, + c = flb_http_client(u_conn, FLB_HTTP_POST, ctx->uri, out_buf, out_size, ctx->tcp_host, ctx->tcp_port, NULL, 0); @@ -1726,6 +1726,12 @@ static int cb_loki_exit(void *data, struct flb_config *config) /* Configuration properties map */ static struct flb_config_map config_map[] = { + { + FLB_CONFIG_MAP_STR, "uri", FLB_LOKI_URI, + 0, FLB_TRUE, offsetof(struct flb_loki, uri), + "Specify a custom HTTP URI. It must start with forward slash." + }, + { FLB_CONFIG_MAP_STR, "tenant_id", NULL, 0, FLB_TRUE, offsetof(struct flb_loki, tenant_id), @@ -1733,6 +1739,7 @@ static struct flb_config_map config_map[] = { "it assumes Loki is running in single-tenant mode and no X-Scope-OrgID " "header is sent." }, + { FLB_CONFIG_MAP_STR, "tenant_id_key", NULL, 0, FLB_TRUE, offsetof(struct flb_loki, tenant_id_key_config), diff --git a/plugins/out_loki/loki.h b/plugins/out_loki/loki.h index 2011cee3ded..6d7e8c33741 100644 --- a/plugins/out_loki/loki.h +++ b/plugins/out_loki/loki.h @@ -55,6 +55,8 @@ struct flb_loki { /* Public configuration properties */ int auto_kubernetes_labels; int drop_single_key; + + flb_sds_t uri; flb_sds_t line_format; flb_sds_t tenant_id; flb_sds_t tenant_id_key_config;