diff --git a/plugins/in_kubernetes_events/kubernetes_events.c b/plugins/in_kubernetes_events/kubernetes_events.c index b2a012c6539..07b7f1503d9 100644 --- a/plugins/in_kubernetes_events/kubernetes_events.c +++ b/plugins/in_kubernetes_events/kubernetes_events.c @@ -921,9 +921,14 @@ static int k8s_events_collect(struct flb_input_instance *ins, } /* NOTE: skipping any processing after streaming socket closes */ - if (ctx->streaming_client->resp.status != 200) { - flb_plg_warn(ins, "events watch failure, http_status=%d payload=%s", - ctx->streaming_client->resp.status, ctx->streaming_client->resp.payload); + if (ctx->streaming_client->resp.status != 200 || ret == FLB_HTTP_ERROR) { + if (ret == FLB_HTTP_ERROR) { + flb_plg_warn(ins, "kubernetes chunked stream error."); + } + else { + flb_plg_warn(ins, "events watch failure, http_status=%d payload=%s", + ctx->streaming_client->resp.status, ctx->streaming_client->resp.payload); + } flb_http_client_destroy(ctx->streaming_client); flb_upstream_conn_release(ctx->current_connection);