Log analysis

 :

1) The default log format configuration of Nginx can be found in /etc/nginx/nginx.conf


log_format main '$remote_addr - $remote_user [$time_local] "$request" '
           '$status $body_bytes_sent "$http_referer" '
           '"$http_user_agent" "$http_x_forwarded_for" $request_time $upstream_response_time';


2) Examples of printed logs

39.105.66.117-mp [11/Sep/2019:19:03:01 +0800] "POST /salesplatform-gateway/users HTTP/1.1" 200 575 "-" "Apache-HttpClient/4.5.5 (Java/1.8. 0_161)" "-" 0.040 0.040
39.105.66.117-mp [11/Sep/2019:19:03:08 +0800] "POST /salesplatform-gateway/users HTTP/1.1" 200 575 "-" "Apache-HttpClient/ 4.5.5 (Java/1.8.0_161)" "-" 0.008 0.008

🦑
1) $remote_addr: client IP address

2) $remote_user: used to record the user name of the remote client

3) $time_local: used to record access time and time zone

4) $request: Used to record the request URL and request method

5) $status: response status code

6) $body_bytes_sent: Number of bytes of file body content sent to the client

7) $http_referer: It can record from which link the user came from

8) $http_user_agent: the browser information used by the user

9) $http_x_forwarded_for: can record the client IP, through the proxy server to record the client's IP address

10) $request_time: refers to the time from receiving the first byte of the user request to sending the response data, that is, $request_time includes the time to receive the client request data, the back-end program response time, and the time to send the response data to the client

11) $upstream_response_time: Time to receive response from upstream server




Enjoy! Follow us for more...

No comments:

Post a Comment

How to Install files and the database in MAMP Server.mp4

  Download now   Enjoy! Follow us for more...