plugins: register new custom plugins
#define FLB_PLUGINS_H
#include <monkey/mk_core.h>
+#include <fluent-bit/flb_custom.h>
#include <fluent-bit/flb_input.h>
#include <fluent-bit/flb_output.h>
#include <fluent-bit/flb_filter.h>
int flb_plugins_register(struct flb_config *config)
{
+ struct flb_custom_plugin *custom;
struct flb_input_plugin *in;
struct flb_output_plugin *out;
struct flb_filter_plugin *filter;
+@FLB_CUSTOM_PLUGINS_ADD@
@FLB_IN_PLUGINS_ADD@
@FLB_OUT_PLUGINS_ADD@
@FLB_FILTER_PLUGINS_ADD@
@@ -48,10 +51,17 @@ void flb_plugins_unregister(struct flb_config *config)
{
struct mk_list *tmp;
struct mk_list *head;
+ struct flb_custom_plugin *custom;
struct flb_input_plugin *in;
struct flb_output_plugin *out;
struct flb_filter_plugin *filter;
+ mk_list_foreach_safe(head, tmp, &config->custom_plugins) {
+ custom = mk_list_entry(head, struct flb_custom_plugin, _head);
+ mk_list_del(&custom->_head);
+ flb_free(custom);
+ }
+
mk_list_foreach_safe(head, tmp, &config->in_plugins) {
in = mk_list_entry(head, struct flb_input_plugin, _head);
mk_list_del(&in->_head);
