lebinh / ngxtop

Real-time metrics for nginx server
MIT License
6.49k stars 473 forks source link

Custom format for multiple websites #86

Open mascor opened 6 years ago

mascor commented 6 years ago

Hi, I'm trying to manage a nginx server with multiple website configurations, so I've different access log file for every website and I created a unique file with all the access requests to parse it with ngxtop.

Now I'm trying to create a custom format to show in ngxtop request_path field the full path of the request because, with default combined format, it shows only the relative path of the requested resource and I cannot understand for which website the request was made.

I tried this "brutal approach" creating this custom log_format:

log_format ngxtop_total '$http_referer - $remote_user [$time_local] '
'"$http_referer" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';

modifing all the entries with the $http_referer, that includes the full path, but ngxtop is not showing any more the request_path field.

I can I solve this problem? Thanks Bye