Welcome! Log In Create A New Profile

Advanced

Re: Rotating Access Logs with $date_local

Igal @ getRailo.org
October 28, 2014 12:50PM
Hello Maxim,
> It is possible - you can use construct appropriate variable, e.g.,
> by using map{} and $time_local. (The $date_local won't work for
> you as you won't be able to set format without SSI.)
Thank you for your prompt reply. I do not have much experience with
nginx configuration so I have a follow up question.

I looked up the docs about map{} at
http://nginx.org/en/docs/http/ngx_http_map_module.html and I tried to
follow the example. I see that $time_local is (in my local time)
"28/Oct/2014:09:30:35 -0700" so I want from that the year, month, and
day. as an experimentation, I tried to add the following:

map $time_local $date {
~\w{11} 0;
}

but I get an error that the '{' character is not valid at that
position. so I tried instead

~\w\w\w\w\w\w\w\w\w\w\w 0;

and then nginx starts up but $date is an empty string.

Can you point me in the right direction? and if it's not too
complicated make a suggestion regarding the regex that I would need
since I must break the $time_local to year, month, and day (or do I need
to create 3 map{} variables for that? now that would be inefficient...)

> On the other hand, it's not recommended as it implies unneeded
> work on each request.
With the amount of traffic that I get, and the way that nginx is
handling it, these few added microseconds should not be an issue IMO and
it would be a much easier solution to implement than an external process
that may or may not work properly.

Thanks a lot!

--
Igal Sapir
Railo Core Developer
http://getRailo.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rotating Access Logs with $date_local

Igal @ getRailo.org October 28, 2014 11:40AM

Re: Rotating Access Logs with $date_local

Maxim Dounin October 28, 2014 11:56AM

Re: Rotating Access Logs with $date_local

Igal @ getRailo.org October 28, 2014 12:50PM

Re: Rotating Access Logs with $date_local

Francis Daly October 28, 2014 01:14PM

Re: Rotating Access Logs with $date_local

Igal @ getRailo.org October 28, 2014 01:20PM

Re: Rotating Access Logs with $date_local

Igal @ getRailo.org October 28, 2014 02:08PM

Re: Rotating Access Logs with $date_local

itpp2012 October 28, 2014 03:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 165
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready