Hello World,
I enabled the GeoIP module in my nginx (configure) and i would like to use the "$geoip_country_name" and "$geoip_city" in my accesslog
I tried to add the two variables in my log format (main) but without sucess
log_format main
'$host $remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$request_time" "$upstream_cache_status" "$geoip_country_name" "$geoip_city"';
Result :
my.domain.fr xxx.xxx.xxx.xxx - - [22/Jul/2015:17:14:21 +0200] "GET /test.html HTTP/1.0" 404 564 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36" "0.001" "HIT" "-" "-"
But i would like this one :
my.domain.fr xxx.xxx.xxx.xxx - - [22/Jul/2015:17:14:21 +0200] "GET /test.html HTTP/1.0" 404 564 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36" "0.001" "HIT" "FR" "Paris"
Thanks for your help,
Best regards,
Jugurtha
I enabled the GeoIP module in my nginx (configure) and i would like to use the "$geoip_country_name" and "$geoip_city" in my accesslog
I tried to add the two variables in my log format (main) but without sucess
log_format main
'$host $remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$request_time" "$upstream_cache_status" "$geoip_country_name" "$geoip_city"';
Result :
my.domain.fr xxx.xxx.xxx.xxx - - [22/Jul/2015:17:14:21 +0200] "GET /test.html HTTP/1.0" 404 564 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36" "0.001" "HIT" "-" "-"
But i would like this one :
my.domain.fr xxx.xxx.xxx.xxx - - [22/Jul/2015:17:14:21 +0200] "GET /test.html HTTP/1.0" 404 564 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36" "0.001" "HIT" "FR" "Paris"
Thanks for your help,
Best regards,
Jugurtha