From 8bc12ab55de24427bee74e0e30f69a4368ffd4ab Mon Sep 17 00:00:00 2001 From: Josh Powers Date: Tue, 12 Apr 2022 11:34:00 -0600 Subject: [PATCH] fix: duplicate influxdb listener writes The influxdb_listener input plugin, when using the upstream parser had bad logic that would write first using the new upstream parser and then attempt to parse the data again with the internal parser right after. This was leading to EOF errors on the internal parser because the data had already been read. Fixes: #10900 --- plugins/inputs/influxdb_listener/influxdb_listener.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/inputs/influxdb_listener/influxdb_listener.go b/plugins/inputs/influxdb_listener/influxdb_listener.go index 674433db9a38a..b6964ac7c8230 100644 --- a/plugins/inputs/influxdb_listener/influxdb_listener.go +++ b/plugins/inputs/influxdb_listener/influxdb_listener.go @@ -213,9 +213,9 @@ func (h *InfluxDBListener) handleWrite() http.HandlerFunc { return func(res http.ResponseWriter, req *http.Request) { if h.ParserType == "upstream" { h.handleWriteUpstreamParser(res, req) + } else { + h.handleWriteInternalParser(res, req) } - - h.handleWriteInternalParser(res, req) } }