File tree Expand file tree Collapse file tree 1 file changed +41
-18
lines changed
plugins/in_calyptia_fleet Expand file tree Collapse file tree 1 file changed +41
-18
lines changed Original file line number Diff line number Diff line change @@ -685,24 +685,47 @@ static int in_calyptia_fleet_collect(struct flb_input_instance *ins,
685685 goto http_error ;
686686 }
687687 header = flb_sds_create_size (4096 );
688- flb_sds_printf (& header ,
689- "[CUSTOM]\n"
690- " Name calyptia\n"
691- " api_key %s\n"
692- " fleet_id %s\n"
693- " add_label fleet_id %s\n"
694- " Fleet.Config_Dir %s\n"
695- " calyptia_host %s\n"
696- " calyptia_port %d\n"
697- " calyptia_tls %s\n" ,
698- ctx -> api_key ,
699- ctx -> fleet_id ,
700- ctx -> fleet_id ,
701- ctx -> config_dir ,
702- ctx -> ins -> host .name ,
703- ctx -> ins -> host .port ,
704- tls_setting_string (ctx -> ins -> use_tls )
705- );
688+ if (ctx -> fleet_name == NULL ) {
689+ flb_sds_printf (& header ,
690+ "[CUSTOM]\n"
691+ " Name calyptia\n"
692+ " api_key %s\n"
693+ " fleet_id %s\n"
694+ " add_label fleet_id %s\n"
695+ " Fleet.Config_Dir %s\n"
696+ " calyptia_host %s\n"
697+ " calyptia_port %d\n"
698+ " calyptia_tls %s\n" ,
699+ ctx -> api_key ,
700+ ctx -> fleet_id ,
701+ ctx -> fleet_id ,
702+ ctx -> config_dir ,
703+ ctx -> ins -> host .name ,
704+ ctx -> ins -> host .port ,
705+ tls_setting_string (ctx -> ins -> use_tls )
706+ );
707+ } else {
708+ flb_sds_printf (& header ,
709+ "[CUSTOM]\n"
710+ " Name calyptia\n"
711+ " api_key %s\n"
712+ " fleet_name %s\n"
713+ " fleet_id %s\n"
714+ " add_label fleet_id %s\n"
715+ " Fleet.Config_Dir %s\n"
716+ " calyptia_host %s\n"
717+ " calyptia_port %d\n"
718+ " calyptia_tls %s\n" ,
719+ ctx -> api_key ,
720+ ctx -> fleet_name ,
721+ ctx -> fleet_id ,
722+ ctx -> fleet_id ,
723+ ctx -> config_dir ,
724+ ctx -> ins -> host .name ,
725+ ctx -> ins -> host .port ,
726+ tls_setting_string (ctx -> ins -> use_tls )
727+ );
728+ }
706729 fwrite (header , strlen (header ), 1 , cfgfp );
707730 flb_sds_destroy (header );
708731 fwrite (data , client -> resp .payload_size , 1 , cfgfp );
You can’t perform that action at this time.
0 commit comments