You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/04/13 07:32:28 UTC

[GitHub] [apisix-ingress-controller] xuminwlt opened a new issue, #962: request help:

xuminwlt opened a new issue, #962:
URL: https://github.com/apache/apisix-ingress-controller/issues/962

   ### Issue description
   
   hi, my apisix is deployed in the form of ingress, and I am going to replace nginx-ingress. When I set up the access_log of apisix, I need to get some information about the ingress environment, as shown in the screenshot below, I roughly understand this customization The variable also needs the functional support of apisix, I think it is still proposed here.
   
   
   https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/log-format/
   
   <img width="420" alt="image" src="https://user-images.githubusercontent.com/5835937/163123257-c0e1634b-b008-49c9-8fbd-2947097849dd.png">
   
   
   ### Environment
   
   - your apisix-ingress-controller version (output of apisix-ingress-controller version --long):
   - your Kubernetes cluster version (output of kubectl version):
   - if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (uname -a):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] xuminwlt commented on issue #962: request help:

Posted by GitBox <gi...@apache.org>.
xuminwlt commented on issue #962:
URL: https://github.com/apache/apisix-ingress-controller/issues/962#issuecomment-1097662316

   @shuaijinchao @tao12345666333 @tokers 
   Or any solution in apisix?
   
   https://github.com/apache/apisix/issues/5982


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #962: request help: Ingress custom variables for logging format in access.log

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #962:
URL: https://github.com/apache/apisix-ingress-controller/issues/962#issuecomment-1100057155

   I don't fully understand your needs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] xuminwlt commented on issue #962: request help: Ingress custom variables for logging format in access.log

Posted by GitBox <gi...@apache.org>.
xuminwlt commented on issue #962:
URL: https://github.com/apache/apisix-ingress-controller/issues/962#issuecomment-1112141240

   Got it, I will close it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tokers commented on issue #962: request help: Ingress custom variables for logging format in access.log

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #962:
URL: https://github.com/apache/apisix-ingress-controller/issues/962#issuecomment-1101002862

   We don't have the `$namespace` and the `$ingress_name` vars.
   
   For `$service_name` and `$service_port`, it's the name and port of the backend k8s service? If so, you cannot get it from APISIX, as what APISIX sees is many Pod IPs and ports.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] xuminwlt commented on issue #962: request help: Ingress custom variables for logging format in access.log

Posted by GitBox <gi...@apache.org>.
xuminwlt commented on issue #962:
URL: https://github.com/apache/apisix-ingress-controller/issues/962#issuecomment-1100653529

   The APISIX's  access log only support NGINX's variable and the access.log look like this with the config:
   
   ```
    http:
       enable_access_log: true         # enable access log or not, default true
       access_log: logs/access.log
       access_log_format: '{"status": $status,"body_bytes_sent": $upstream_response_length,"scheme":"$scheme","http_user_agent":"$http_user_agent","request_length": $request_length,"request_body":"$request_length","remote_addr":"$remote_addr","request_time": $upstream_response_time,"host":"$host","server_port":"80","clientIp":"$remote_addr","client_addr":"$remote_addr:$remote_port","request_uri":"$request_uri","time":"$time_iso8601","http_referer":"$http_referer","x_forwarded_for":"$http_x_forwarded_for","x_real_ip":"$http_x_real_ip","upstream_addr":"$upstream_addr","method":"$request_method","server_addr":"$server_addr","appName":"-$server_name","backendName":"-@kubernetes","source":"apisixAccess","trace_id":""}'
       access_log_format_escape: json
   
   ```
   access.log
   ```
   {"status": 200,"body_bytes_sent": 710,"scheme":"http","http_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36","request_length": 569,"request_body":"569","remote_addr":"::1","request_time": 0.003,"host":"localhost","server_port":"80","clientIp":"::1","client_addr":"::1:55367","request_uri":"/headers","time":"2022-04-13T16:42:54+08:00","http_referer":"","x_forwarded_for":"","x_real_ip":"","upstream_addr":"127.0.0.1:1980","method":"GET","server_addr":"::1","appName":"-_","backendName":"-@kubernetes","source":"apisixAccess","uber_trace_id":""}
   
   ```
   
   Unfortunately, I also need several other parameters, refer to the partially custom variables using nginx-controller. These variables are not supported in APISIX. So ask if there is any way to get some of the above variable information.
   
   For example:
   ![image](https://user-images.githubusercontent.com/5835937/163675085-4b6418f8-0940-4319-b99e-d2d736918694.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] xuminwlt closed issue #962: request help: Ingress custom variables for logging format in access.log

Posted by GitBox <gi...@apache.org>.
xuminwlt closed issue #962: request help: Ingress custom variables for logging format in access.log
URL: https://github.com/apache/apisix-ingress-controller/issues/962


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org