Skip to content

backport change to v4.0.1 #10357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion plugins/out_es/es.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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",
Expand Down