Skip to content

Commit

Permalink
out_es: rename flb_sds_snprintf_realloc -> flb_sds_snprintf
Browse files Browse the repository at this point in the history
Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 authored and edsiper committed Dec 18, 2021
1 parent b229a3d commit 0fbca8d
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions plugins/out_es/es.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,16 +343,16 @@ static int elasticsearch_format(struct flb_config *config,
ctx->index, &tm);
es_index = index_formatted;
if (ctx->suppress_type_name) {
index_len = flb_sds_snprintf_realloc(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT_WITHOUT_TYPE,
es_index);
index_len = flb_sds_snprintf(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT_WITHOUT_TYPE,
es_index);
}
else {
index_len = flb_sds_snprintf_realloc(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT,
es_index, ctx->type);
index_len = flb_sds_snprintf(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT,
es_index, ctx->type);
}
}

Expand Down Expand Up @@ -455,16 +455,16 @@ static int elasticsearch_format(struct flb_config *config,
es_index = logstash_index;
if (ctx->generate_id == FLB_FALSE) {
if (ctx->suppress_type_name) {
index_len = flb_sds_snprintf_realloc(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT_WITHOUT_TYPE,
es_index);
index_len = flb_sds_snprintf(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT_WITHOUT_TYPE,
es_index);
}
else {
index_len = flb_sds_snprintf_realloc(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT,
es_index, ctx->type);
index_len = flb_sds_snprintf(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT,
es_index, ctx->type);
}
}
}
Expand Down Expand Up @@ -506,32 +506,32 @@ static int elasticsearch_format(struct flb_config *config,
hash[0], hash[1], hash[2], hash[3],
hash[4], hash[5], hash[6], hash[7]);
if (ctx->suppress_type_name) {
index_len = flb_sds_snprintf_realloc(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT_ID_WITHOUT_TYPE,
es_index, es_uuid);
index_len = flb_sds_snprintf(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT_ID_WITHOUT_TYPE,
es_index, es_uuid);
}
else {
index_len = flb_sds_snprintf_realloc(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT_ID,
es_index, ctx->type, es_uuid);
index_len = flb_sds_snprintf(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT_ID,
es_index, ctx->type, es_uuid);
}
}
if (ctx->ra_id_key) {
id_key_str = es_get_id_value(ctx ,&map);
if (id_key_str) {
if (ctx->suppress_type_name) {
index_len = flb_sds_snprintf_realloc(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT_ID_WITHOUT_TYPE,
es_index, id_key_str);
index_len = flb_sds_snprintf(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT_ID_WITHOUT_TYPE,
es_index, id_key_str);
}
else {
index_len = flb_sds_snprintf_realloc(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT_ID,
es_index, ctx->type, id_key_str);
index_len = flb_sds_snprintf(&j_index,
flb_sds_alloc(j_index),
ES_BULK_INDEX_FMT_ID,
es_index, ctx->type, id_key_str);
}
flb_sds_destroy(id_key_str);
id_key_str = NULL;
Expand Down

0 comments on commit 0fbca8d

Please sign in to comment.