diff --git a/pkg/distributor/distributor.go b/pkg/distributor/distributor.go index 4cd3972eb499c..f21b4d0e5cbb8 100644 --- a/pkg/distributor/distributor.go +++ b/pkg/distributor/distributor.go @@ -991,7 +991,7 @@ func isJSON(line string) bool { } func detectLevelFromLogLine(log string) string { - if strings.Contains(log, "info:") || strings.Contains(log, "INFO:") || + if strings.Contains(log, "info:") || strings.Contains(log, "INFO:") || strings.Contains(log, "info") || strings.Contains(log, "INFO") { return logLevelInfo } diff --git a/pkg/distributor/distributor_test.go b/pkg/distributor/distributor_test.go index fb900fe1e567e..19019e62dd4a3 100644 --- a/pkg/distributor/distributor_test.go +++ b/pkg/distributor/distributor_test.go @@ -1712,19 +1712,19 @@ func Test_detectLogLevelFromLogEntry(t *testing.T) { expectedLogLevel: logLevelError, }, { - name: "json log line with an INFO in block case", - entry: logproto.Entry{ - Line: `{"foo":"bar","msg":"message with keyword INFO get picked up"}`, - }, - expectedLogLevel: logLevelInfo, - }, - { - name: "logfmt log line with an INFO and not level returns info log level", - entry: logproto.Entry{ - Line: `foo=bar msg="message with info and not level should get picked up"`, - }, - expectedLogLevel: logLevelInfo, - }, + name: "json log line with an INFO in block case", + entry: logproto.Entry{ + Line: `{"foo":"bar","msg":"message with keyword INFO get picked up"}`, + }, + expectedLogLevel: logLevelInfo, + }, + { + name: "logfmt log line with an INFO and not level returns info log level", + entry: logproto.Entry{ + Line: `foo=bar msg="message with info and not level should get picked up"`, + }, + expectedLogLevel: logLevelInfo, + }, { name: "logfmt log line with a warn", entry: logproto.Entry{