diff --git a/plugins/out_cloudwatch_logs/cloudwatch_logs.c b/plugins/out_cloudwatch_logs/cloudwatch_logs.c index a37039ca500..e197fe8841b 100644 --- a/plugins/out_cloudwatch_logs/cloudwatch_logs.c +++ b/plugins/out_cloudwatch_logs/cloudwatch_logs.c @@ -213,16 +213,6 @@ static int cb_cloudwatch_init(struct flb_output_instance *ins, ctx->sts_endpoint = (char *) tmp; } - /* init log streams */ - if (ctx->log_stream_name) { - ctx->stream.name = flb_sds_create(ctx->log_stream_name); - if (!ctx->stream.name) { - flb_errno(); - goto error; - } - ctx->stream_created = FLB_FALSE; - } - /* one tls instance for provider, one for cw client */ ctx->cred_tls = flb_tls_create(FLB_TLS_CLIENT_MODE, FLB_TRUE, @@ -484,19 +474,10 @@ void flb_cloudwatch_ctx_destroy(struct flb_cloudwatch *ctx) flb_sds_destroy(ctx->stream_name); } - if (ctx->log_stream_name) { - if (ctx->stream.name) { - flb_sds_destroy(ctx->stream.name); - } - if (ctx->stream.sequence_token) { - flb_sds_destroy(ctx->stream.sequence_token); - } - } else { - mk_list_foreach_safe(head, tmp, &ctx->streams) { - stream = mk_list_entry(head, struct log_stream, _head); - mk_list_del(&stream->_head); - log_stream_destroy(stream); - } + mk_list_foreach_safe(head, tmp, &ctx->streams) { + stream = mk_list_entry(head, struct log_stream, _head); + mk_list_del(&stream->_head); + log_stream_destroy(stream); } flb_free(ctx); } diff --git a/plugins/out_cloudwatch_logs/cloudwatch_logs.h b/plugins/out_cloudwatch_logs/cloudwatch_logs.h index e89cd3ce1e9..7fe8bf0b764 100644 --- a/plugins/out_cloudwatch_logs/cloudwatch_logs.h +++ b/plugins/out_cloudwatch_logs/cloudwatch_logs.h @@ -135,10 +135,7 @@ struct flb_cloudwatch { struct flb_record_accessor *ra_group; struct flb_record_accessor *ra_stream; - /* if we're writing to a static log stream, we'll use this */ - struct log_stream stream; - int stream_created; - /* if the log stream is dynamic, we'll use this */ + /* stores log streams we're putting to */ struct mk_list streams; /* buffers for data processing and request payload */