phikai
October 18, 2012, 3:57pm
1
Does anyone have an access_log format for nginx that works with multiple virtual hosts? I’ve tried a few different setups:
log_format combined_vhost_log
’$remote_addr - $server_name - $remote_user [$time_local] “$request” ‘
’$status $body_bytes_sent “$http_referer” ‘
’"$http_user_agent"’;
log_format combined_vhost_log
’ $server_name - $remote_addr - $remote_user [$time_local] “$request” ‘
’$status $body_bytes_sent “$http_referer” ‘
’"$http_user_agent"’;
Both of those are giving me invalid log lines when I specify the log format as common_vhost. It’s also unable to auto-detect a format.
phikai
October 18, 2012, 6:41pm
2
This is the log format we ended up going with:
log_format vhosts ‘$host $remote_addr - $remote_user [$time_local] “$request” $status $body_bytes_sent “$http_referer” “$http_user_agent”’;
It seems to be working for now.
matthieu
(Matthieu Aubry)
October 19, 2012, 1:29pm
3
Interesting, could you please post the Log format name and format, in: Log analytics list of improvements · Issue #3163 · matomo-org/matomo · GitHub
we would be happy to add it to the list of supported segments!
phikai
October 19, 2012, 1:31pm
4
Matt,
We’re using that format setup in Nginx and it matches your common_complete parser. Nothing you guys needed to do, it was just a matter of finding out what to setup for the nginx logs.
matthieu
(Matthieu Aubry)
October 19, 2012, 1:44pm
5
OK so maybe we could add this to the README though? please suggest a new README patch?
phikai
October 19, 2012, 2:06pm
6