@@ -91,6 +91,13 @@ struct flb_az_li* flb_az_li_ctx_create(struct flb_output_instance *ins,
9191 return NULL ;
9292 }
9393
94+ /* config: 'stream_name' */
95+ if (!ctx -> stream_name ) {
96+ flb_plg_error (ins , "property 'stream_name' is not defined" );
97+ flb_az_li_ctx_destroy (ctx );
98+ return NULL ;
99+ }
100+
94101 /* Allocate and set auth url */
95102 ctx -> auth_url = flb_sds_create_size (sizeof (FLB_AZ_LI_AUTH_URL_TMPLT ) - 1 +
96103 flb_sds_len (ctx -> tenant_id ));
@@ -106,15 +113,15 @@ struct flb_az_li* flb_az_li_ctx_create(struct flb_output_instance *ins,
106113 ctx -> dce_u_url = flb_sds_create_size (sizeof (FLB_AZ_LI_DCE_URL_TMPLT ) - 1 +
107114 flb_sds_len (ctx -> dce_url ) +
108115 flb_sds_len (ctx -> dcr_id ) +
109- flb_sds_len (ctx -> table_name ));
116+ flb_sds_len (ctx -> stream_name ));
110117 if (!ctx -> dce_u_url ) {
111118 flb_errno ();
112119 flb_az_li_ctx_destroy (ctx );
113120 return NULL ;
114121 }
115122 flb_sds_snprintf (& ctx -> dce_u_url , flb_sds_alloc (ctx -> dce_u_url ),
116123 FLB_AZ_LI_DCE_URL_TMPLT , ctx -> dce_url ,
117- ctx -> dcr_id , ctx -> table_name );
124+ ctx -> dcr_id , ctx -> stream_name );
118125
119126 /* Initialize the auth mutex */
120127 pthread_mutex_init (& ctx -> token_mutex , NULL );
@@ -138,8 +145,8 @@ struct flb_az_li* flb_az_li_ctx_create(struct flb_output_instance *ins,
138145 }
139146 flb_output_upstream_set (ctx -> u_dce , ins );
140147
141- flb_plg_info (ins , "dce_url='%s', dcr='%s', table='%s', stream='Custom- %s'" ,
142- ctx -> dce_url , ctx -> dcr_id , ctx -> table_name , ctx -> table_name );
148+ flb_plg_info (ins , "dce_url='%s', dcr='%s', table='%s', stream='%s'" ,
149+ ctx -> dce_url , ctx -> dcr_id , ctx -> table_name , ctx -> stream_name );
143150
144151 return ctx ;
145152}
0 commit comments