From 90c9218f0786d2793270d37baa0f3a1b7f87edc9 Mon Sep 17 00:00:00 2001 From: Lucas POUZAC Date: Thu, 3 Jul 2025 17:49:53 +0200 Subject: [PATCH] Fix remove '\n' before monkey on input-tcp mode --- input_tcp.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/input_tcp.go b/input_tcp.go index e31217cc..f111dfbd 100644 --- a/input_tcp.go +++ b/input_tcp.go @@ -117,7 +117,9 @@ func (i *TCPInput) handleConnection(conn net.Conn) { if bytes.Equal(payloadSeparatorAsBytes[1:], line) { // unread the '\n' before monkeys - buffer.UnreadByte() + if buffer.Len() > 0 { + buffer.Truncate(buffer.Len() - 1) + } var msg Message msg.Meta, msg.Data = payloadMetaWithBody(buffer.Bytes()) i.data <- &msg