[PATCH] small userid module change
Martin Bruse
zondolfin at gmail.com
Mon Feb 28 16:29:43 MSK 2011
Thank you!
//Martin
On Mon, Feb 28, 2011 at 2:22 PM, Igor Sysoev <igor at sysoev.ru> wrote:
> On 28.02.2011, at 12:08, Martin Bruse wrote:
>
> Please, just tell me if there is no hope, so that I can get on with setting
> up my own nginx-patch-repository :)
>
> I really would like the possibility to have the uid in a single column.
> What would otherwise be the best way?
>
> So basically you need that $uid_set logs set userid value, and if it's not
> set got userid value ?
> This patch will break existent setup, because $uid_set should log only set
> userid.
> In 0.9.0 you can use
>
> map $uid_set $uid {
> default $uid_set;
> "" $uid_got;
> }
>
> //Martin
> On 25 Feb 2011 10:40, "Martin Bruse" <zondolfin at gmail.com> wrote:
> > Hello list!
> >
> > I first sent this mail to nginx at nginx.org, but realized that this list
> is
> > probably more suitable. Especially since I got no response whatsoever :)
> >
> > I wanted to use my nginx logs to power click track analysis like
> > http://statviz.sourceforge.net/ for example, and therefore I used the
> > userid module.
> >
> > I realized quickly that it either sets $uid_set or $uid_got, never
> > both, which makes it hard to get one single column in the logfile that
> > entails the userid.
> >
> > So I devised the following patch for this purpose:
> >
> >
> -----------------------------------8<--------------------------------------------
> > --- nginx-0.7.67/src/http/modules/ngx_http_userid_filter_module.c
> > 2010-06-07
> > 11:54:19.000000000 +0200
> > +++ nginx-0.7.67-martin//src/http/modules/ngx_http_userid_filter_module.c
> > 2011-02-24
> > 13:16:20.000000000 +0100
> > @@ -275,9 +275,11 @@
> >
> > ctx = ngx_http_get_module_ctx(r, ngx_http_userid_filter_module);
> >
> > - if (ctx == NULL || ctx->uid_set[3] == 0) {
> > - v->not_found = 1;
> > - return NGX_OK;
> > + if (ctx == NULL) {
> > + v->not_found = 1;
> > + return NGX_OK;
> > + } else if (ctx->uid_set[3] == 0) {
> > + return ngx_http_userid_got_variable(r, v, data);
> > }
> >
> > conf = ngx_http_get_module_loc_conf(r, ngx_http_userid_filter_module);
> >
> -----------------------------------8<--------------------------------------------
> >
> > Since I have no real ambition to have my own fork of nginx, I would
> > love to hear about the possibilities to get this modification, or
> > another that solves my problem in a more nginxy way, into the main
> > branch.
> >
> > regards,
> > //Martin Bruse
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://nginx.org/mailman/listinfo/nginx-devel
>
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://nginx.org/mailman/listinfo/nginx-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx-devel/attachments/20110228/f47883de/attachment.html>
More information about the nginx-devel
mailing list