Pārlūkot izejas kodu

write overridden host into request packet for log captures

Tobias Begalke 6 gadi atpakaļ
vecāks
revīzija
edbd6ad703
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 5 0
      main.go

+ 5 - 0
main.go

@@ -301,6 +301,11 @@ func nginxLogCapture(logfile, format string) {
 			continue
 		}
 
+		host := config.HostName
+		if host == "" {
+			host = "[not available]"
+		}
+
 		request := data.Request{
 			IpSrc:     remote,
 			Origin:    remote,