From 6aa48def3a678ce2b76e799c47a07652021c26ba Mon Sep 17 00:00:00 2001 From: Peter Pan Date: Fri, 18 Oct 2019 09:08:02 +0800 Subject: [PATCH 1/2] add remote_addr in layer 4 access log original: [18/Oct/2019:00:47:53 +0000] TCP 200 4333 81 0.002 new: [10.6.124.202] [18/Oct/2019:01:05:15 +0000] TCP 200 4333 81 0.002 --- internal/ingress/controller/config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/ingress/controller/config/config.go b/internal/ingress/controller/config/config.go index c6d5c2d8ba..2683ede21c 100644 --- a/internal/ingress/controller/config/config.go +++ b/internal/ingress/controller/config/config.go @@ -56,7 +56,7 @@ const ( logFormatUpstream = `$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr $upstream_response_length $upstream_response_time $upstream_status $req_id` - logFormatStream = `[$time_local] $protocol $status $bytes_sent $bytes_received $session_time` + logFormatStream = `[$remote_addr] [$time_local] $protocol $status $bytes_sent $bytes_received $session_time` // http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_buffer_size // Sets the size of the buffer used for sending data. From ee24bf1bbcfc85ed41c629fcbd0b005e3301b6fe Mon Sep 17 00:00:00 2001 From: Peter Pan Date: Mon, 21 Oct 2019 10:18:04 +0800 Subject: [PATCH 2/2] Doc: Add `remote_addr` into default values in configmap for TCP logging format --- docs/user-guide/nginx-configuration/configmap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/nginx-configuration/configmap.md b/docs/user-guide/nginx-configuration/configmap.md index 031e191b59..1ab43dd280 100755 --- a/docs/user-guide/nginx-configuration/configmap.md +++ b/docs/user-guide/nginx-configuration/configmap.md @@ -60,7 +60,7 @@ The following table shows a configuration option's name, type, and the default v |[large-client-header-buffers](#large-client-header-buffers)|string|"4 8k"| |[log-format-escape-json](#log-format-escape-json)|bool|"false"| |[log-format-upstream](#log-format-upstream)|string|`$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr $upstream_response_length $upstream_response_time $upstream_status $req_id`| -|[log-format-stream](#log-format-stream)|string|`[$time_local] $protocol $status $bytes_sent $bytes_received $session_time`| +|[log-format-stream](#log-format-stream)|string|`[$remote_addr] [$time_local] $protocol $status $bytes_sent $bytes_received $session_time`| |[enable-multi-accept](#enable-multi-accept)|bool|"true"| |[max-worker-connections](#max-worker-connections)|int|16384| |[max-worker-open-files](#max-worker-open-files)|int|0|