From ef7a5d2dd48c5d97d581434d5127d1949bf48b28 Mon Sep 17 00:00:00 2001 From: Todd Kennedy <95242064+tkennedy1-godaddy@users.noreply.github.com> Date: Mon, 19 May 2025 16:03:42 -0700 Subject: [PATCH] backport change to v4.0.1 Signed-off-by: Todd Kennedy <95242064+tkennedy1-godaddy@users.noreply.github.com> --- plugins/out_es/es.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/out_es/es.c b/plugins/out_es/es.c index c896b1ed258..4e653e7e349 100644 --- a/plugins/out_es/es.c +++ b/plugins/out_es/es.c @@ -627,6 +627,11 @@ static int cb_es_init(struct flb_output_instance *ins, return -1; } + if (ctx->index == NULL && ctx->logstash_format == FLB_FALSE && ctx->generate_id == FLB_FALSE) { + flb_plg_error(ins, "cannot initialize plugin, index is not set and logstash_format and generate_id are both off"); + return -1; + } + flb_plg_debug(ctx->ins, "host=%s port=%i uri=%s index=%s type=%s", ins->host.name, ins->host.port, ctx->uri, ctx->index, ctx->type); @@ -937,7 +942,7 @@ static void cb_es_flush(struct flb_event_chunk *event_chunk, /* * If trace_error is set, trace the actual * response from Elasticsearch explaining the problem. - * Trace_Output can be used to see the request. + * Trace_Output can be used to see the request. */ if (pack_size < 4000) { flb_plg_debug(ctx->ins, "error caused by: Input\n%.*s\n",