Skip to content

Commit baefeda

Browse files
pwhelanedsiper
authored andcommitted
custom_calyptia: set net.* on in_calyptia_fleet.
Signed-off-by: Phillip Whelan <[email protected]>
1 parent 8df9f2b commit baefeda

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

plugins/custom_calyptia/calyptia.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ flb_sds_t custom_calyptia_pipeline_config_get(struct flb_config *ctx)
215215

216216
int set_fleet_input_properties(struct calyptia *ctx, struct flb_input_instance *fleet)
217217
{
218+
struct mk_list *head;
219+
struct mk_list *tmp;
220+
struct flb_kv *keyval;
221+
218222
if (!fleet) {
219223
flb_plg_error(ctx->ins, "invalid fleet input instance");
220224
return -1;
@@ -255,6 +259,12 @@ int set_fleet_input_properties(struct calyptia *ctx, struct flb_input_instance *
255259
flb_input_set_property(fleet, "interval_nsec", ctx->fleet_interval_nsec);
256260
}
257261

262+
mk_list_foreach(head, &ctx->ins->net_properties) {
263+
keyval = mk_list_entry(head, struct flb_kv, _head);
264+
flb_debug("set fleet net property: %s=%s", keyval->key, keyval->val);
265+
flb_input_set_property(fleet, keyval->key, keyval->val);
266+
}
267+
258268
return 0;
259269
}
260270

@@ -267,6 +277,8 @@ static struct flb_output_instance *setup_cloud_output(struct flb_config *config,
267277
struct flb_slist_entry *val = NULL;
268278
flb_sds_t label;
269279
struct flb_config_map_val *mv;
280+
struct mk_list *tmp;
281+
struct flb_kv *keyval;
270282

271283
cloud = flb_output_new(config, "calyptia", ctx, FLB_FALSE);
272284

@@ -354,6 +366,12 @@ static struct flb_output_instance *setup_cloud_output(struct flb_config *config,
354366
flb_sds_destroy(label);
355367
}
356368

369+
mk_list_foreach(head, &ctx->ins->net_properties) {
370+
keyval = mk_list_entry(head, struct flb_kv, _head);
371+
flb_debug("set cloud net property: %s=%s", keyval->key, keyval->val);
372+
flb_output_set_property(cloud, keyval->key, keyval->val);
373+
}
374+
357375
#ifdef FLB_HAVE_CHUNK_TRACE
358376
flb_output_set_property(cloud, "pipeline_id", ctx->pipeline_id);
359377
#endif /* FLB_HAVE_CHUNK_TRACE */
@@ -727,6 +745,7 @@ static struct flb_config_map config_map[] = {
727745
FLB_CONFIG_MAP_MULT, FLB_TRUE, offsetof(struct calyptia, add_labels),
728746
"Label to append to the generated metric."
729747
},
748+
730749
{
731750
FLB_CONFIG_MAP_STR, "machine_id", NULL,
732751
0, FLB_TRUE, offsetof(struct calyptia, machine_id),
@@ -790,4 +809,5 @@ struct flb_custom_plugin custom_calyptia_plugin = {
790809
.config_map = config_map,
791810
.cb_init = cb_calyptia_init,
792811
.cb_exit = cb_calyptia_exit,
812+
.flags = FLB_CUSTOM_NET_CLIENT,
793813
};

0 commit comments

Comments
 (0)