Explorar o código

write overridden host into request packet for log captures

Tobias Begalke %!s(int64=6) %!d(string=hai) anos
pai
achega
edbd6ad703
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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,