Skip to content

Commit

Permalink
custom_calyptia: pass the fleet_id parameter and label to out_calyptia.
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Whelan <[email protected]>
  • Loading branch information
pwhelan committed Sep 4, 2023
1 parent f7731f3 commit f94c4ad
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion plugins/custom_calyptia/calyptia.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static struct flb_output_instance *setup_cloud_output(struct flb_config *config,

label = flb_sds_create_size(strlen(key->str) + strlen(val->str) + 1);

if(!label) {
if (!label) {
flb_free(ctx);
return NULL;
}
Expand Down Expand Up @@ -309,6 +309,20 @@ static struct flb_output_instance *setup_cloud_output(struct flb_config *config,
flb_output_set_property(cloud, "tls.verify", "false");
}

if (ctx->fleet_id) {
flb_output_set_property(cloud, "fleet_id", ctx->fleet_id);
label = flb_sds_create_size(strlen("fleet_id") + strlen(ctx->fleet_id) + 1);

if (!label) {
flb_free(ctx);
return NULL;
}

flb_sds_printf(&label, "fleet_id %s", ctx->fleet_id);
flb_output_set_property(cloud, "add_label", label);
flb_sds_destroy(label);
}

#ifdef FLB_HAVE_CHUNK_TRACE
flb_output_set_property(cloud, "pipeline_id", ctx->pipeline_id);
#endif /* FLB_HAVE_CHUNK_TRACE */
Expand Down

0 comments on commit f94c4ad

Please sign in to comment.