Convert $msec to sec

I need to log the seconds since epoch (without the millisecond
resolution)
in the access_log file

is there is a way to convert the $msec to seconds or drop the
exponential
part of the time . Probably using the map function?.

Thank you,

On Sunday 03 April 2016 11:31:08 Anoop A. wrote:

I need to log the seconds since epoch (without the millisecond resolution)
in the access_log file

is there is a way to convert the $msec to seconds or drop the exponential
part of the time . Probably using the map function?.

It’s easy with the map directive:

map $msec $sec {
    ~^(?P<_sec>.+)\. $_sec;
}

wbr, Valentin V. Bartenev

Thanks Valentin. That works.

Can you explain

On Sunday 03 April 2016 20:40:33 Anoop A. wrote:

Thanks Valentin. That works.

Can you explain

This is simple named subpattern:
http://www.pcre.org/original/doc/html/pcrepattern.html#SEC16

used in the map directive:
http://nginx.org/r/map

wbr, Valentin V. Bartenev

On 4/3/2016 8:10 AM, Anoop A. wrote:

Thanks Valentin. That works.

Can you explain
see http://nginx.org/en/docs/http/ngx_http_map_module.html

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs