Nginx log timestamp

Hello.

It currently have this custom log format:
log_format js ‘$remote_addr [$time_local] $request $country
$geoip_region’;

It is possible to get the unix timestamp ? Ex: 1260538968 ?

Posted at Nginx Forum:

Hello!

On Fri, Dec 11, 2009 at 08:39:33AM -0500, keepwalking wrote:

Hello.

It currently have this custom log format:
log_format js ‘$remote_addr [$time_local] $request $country $geoip_region’;

It is possible to get the unix timestamp ? Ex: 1260538968 ?

$msec will give you unix timestamp with milliseconds, i.e.
something like “1260538968.123”.

Maxim D.

Thank you !

The solution is perfect :slight_smile:

Posted at Nginx Forum: