From f56d4db0908a9a79d2bdb245a3e05be5be648657 Mon Sep 17 00:00:00 2001 From: Brian Floersch Date: Fri, 3 Jan 2025 12:00:42 -0500 Subject: [PATCH] Correctly tag mulitline logs for regex multi line handler. (#32647) --- pkg/logs/internal/decoder/multiline_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/logs/internal/decoder/multiline_handler.go b/pkg/logs/internal/decoder/multiline_handler.go index 67fba384cbb42..9f461dc7716ff 100644 --- a/pkg/logs/internal/decoder/multiline_handler.go +++ b/pkg/logs/internal/decoder/multiline_handler.go @@ -168,7 +168,7 @@ func (h *MultiLineHandler) sendBuffer() { if h.isBufferTruncated && pkgconfigsetup.Datadog().GetBool("logs_config.tag_truncated_logs") { msg.ParsingExtra.Tags = append(msg.ParsingExtra.Tags, message.TruncatedReasonTag("multiline_regex")) } - if h.isBufferTruncated && pkgconfigsetup.Datadog().GetBool("logs_config.tag_multi_line_logs") { + if h.linesCombined > 1 && pkgconfigsetup.Datadog().GetBool("logs_config.tag_multi_line_logs") { msg.ParsingExtra.Tags = append(msg.ParsingExtra.Tags, message.MultiLineSourceTag(h.multiLineTagValue)) } h.outputFn(msg)