diff --git a/plugins/out_fluentd/out_fluentd.c b/plugins/out_fluentd/out_fluentd.c index 064cd8eee75..9d04b7324b8 100644 --- a/plugins/out_fluentd/out_fluentd.c +++ b/plugins/out_fluentd/out_fluentd.c @@ -65,7 +65,7 @@ int cb_fluentd_pre_run(void *out_context, struct flb_config *config) int cb_fluentd_flush(void *data, size_t bytes, void *out_context) { - int fd; + int fd, len; struct flb_out_fluentd_config *ctx = out_context; (void) ctx; @@ -76,7 +76,10 @@ int cb_fluentd_flush(void *data, size_t bytes, void *out_context) } /* FIXME: plain TCP write */ - return write(fd, data, bytes); + len = write(fd, data, bytes); + close(fd); + + return len; } /* Plugin reference */