瀏覽代碼

write overridden host into request packet for log captures

Tobias Begalke 6 年之前
父節點
當前提交
edbd6ad703
共有 1 個文件被更改,包括 5 次插入0 次删除
  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,