@@ -81,8 +81,11 @@ static int http_put(struct flb_out_doris *ctx,
8181 const char * host , int port ,
8282 const void * body , size_t body_len ,
8383 const char * tag , int tag_len ,
84- const char * label , int label_len )
84+ const char * label , int label_len ,
85+ const char * endpoint_type )
8586{
87+ flb_plg_debug (ctx -> ins , "send to %s" , endpoint_type );
88+
8689 int ret ;
8790 int out_ret = FLB_OK ;
8891 size_t b_sent ;
@@ -144,7 +147,9 @@ static int http_put(struct flb_out_doris *ctx,
144147 /* Append headers */
145148 flb_http_add_header (c , "format" , 6 , "json" , 4 );
146149 flb_http_add_header (c , "read_json_by_line" , 17 , "true" , 4 );
147- flb_http_add_header (c , "Expect" , 6 , "100-continue" , 12 );
150+ if (strcasecmp (endpoint_type , "fe" ) == 0 ) {
151+ flb_http_add_header (c , "Expect" , 6 , "100-continue" , 12 );
152+ }
148153 flb_http_add_header (c , "User-Agent" , 10 , "Fluent-Bit" , 10 );
149154
150155 if (ctx -> add_label ) {
@@ -188,7 +193,7 @@ static int http_put(struct flb_out_doris *ctx,
188193 memcpy (redirect_port , mid + 1 , end - (mid + 1 ));
189194
190195 out_ret = http_put (ctx , redirect_host , atoi (redirect_port ),
191- body , body_len , tag , tag_len , label , label_len );
196+ body , body_len , tag , tag_len , label , label_len , "be" );
192197 }
193198 else if (c -> resp .status == 200 && c -> resp .payload_size > 0 ) {
194199 ret = flb_pack_json (c -> resp .payload , c -> resp .payload_size ,
@@ -338,7 +343,7 @@ static void cb_doris_flush(struct flb_event_chunk *event_chunk,
338343 }
339344
340345 ret = http_put (ctx , ctx -> host , ctx -> port , out_body , out_size ,
341- event_chunk -> tag , flb_sds_len (event_chunk -> tag ), label , len );
346+ event_chunk -> tag , flb_sds_len (event_chunk -> tag ), label , len , ctx -> endpoint_type );
342347 flb_sds_destroy (out_body );
343348
344349 if (ret == FLB_OK && ctx -> log_progress_interval > 0 ) {
@@ -360,6 +365,12 @@ static int cb_doris_exit(void *data, struct flb_config *config)
360365
361366/* Configuration properties map */
362367static struct flb_config_map config_map [] = {
368+ // endpoint_type
369+ {
370+ FLB_CONFIG_MAP_STR , "endpoint_type" , NULL ,
371+ 0 , FLB_TRUE , offsetof(struct flb_out_doris , endpoint_type ),
372+ "Set endpoint type: 'fe' (frontend) or 'be' (backend)"
373+ },
363374 // user
364375 {
365376 FLB_CONFIG_MAP_STR , "user" , NULL ,
0 commit comments