diff --git a/plugins/out_azure_blob/azure_blob.c b/plugins/out_azure_blob/azure_blob.c index de4ee41beaf..1ef9be49552 100644 --- a/plugins/out_azure_blob/azure_blob.c +++ b/plugins/out_azure_blob/azure_blob.c @@ -668,7 +668,8 @@ static int process_blob_chunk(struct flb_azure_blob *ctx, struct flb_event_chunk continue; } - ret = azb_db_file_insert(ctx, source, ctx->endpoint, file_path, file_size); + ret = azb_db_file_insert(ctx, source, ctx->real_endpoint, file_path, file_size); + if (ret == -1) { flb_plg_error(ctx->ins, "cannot insert blob file into database: %s (size=%lu)", file_path, file_size); @@ -893,10 +894,13 @@ static void cb_azb_blob_file_upload(struct flb_config *config, void *out_context /* just continue, the row info was retrieved */ } - if (strcmp(file_destination, ctx->endpoint) != 0) { + + if (strcmp(file_destination, ctx->real_endpoint) != 0) { flb_plg_info(ctx->ins, - "endpoint change detected, restarting file : %s", - file_path); + "endpoint change detected, restarting file : %s\n%s\n%s", + file_path, + file_destination, + ctx->real_endpoint); info->active_upload = FLB_FALSE; diff --git a/plugins/out_azure_blob/azure_blob_db.c b/plugins/out_azure_blob/azure_blob_db.c index 9ba5e0948d3..fba43e74bbc 100644 --- a/plugins/out_azure_blob/azure_blob_db.c +++ b/plugins/out_azure_blob/azure_blob_db.c @@ -751,7 +751,7 @@ int azb_db_file_part_get_next(struct flb_azure_blob *ctx, *part_delivery_attempts = sqlite3_column_int64(ctx->stmt_get_next_file_part, 5); tmp = (char *) sqlite3_column_text(ctx->stmt_get_next_file_part, 6); *file_delivery_attempts = sqlite3_column_int64(ctx->stmt_get_next_file_part, 7); - tmp_destination = (char *) sqlite3_column_text(ctx->stmt_get_next_file_part, 8); + tmp_destination = (char *) sqlite3_column_text(ctx->stmt_get_next_file_part, 9); } else if (ret == SQLITE_DONE) { /* no records */