From 29998a8959d9ed4d31d6034eaa3a1ec9d178e191 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Thu, 9 Jan 2020 18:27:14 +0300 Subject: [PATCH] - querylog: incorrect client IP when blocked by hosts filter --- querylog/querylog_file.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/querylog/querylog_file.go b/querylog/querylog_file.go index e0540f43..02296a98 100644 --- a/querylog/querylog_file.go +++ b/querylog/querylog_file.go @@ -561,7 +561,9 @@ func decode(ent *logEntry, str string) { } switch k { case "IP": - ent.IP = v + if len(ent.IP) == 0 { + ent.IP = v + } case "T": ent.Time, err = time.Parse(time.RFC3339, v)