Welcome! Log In Create A New Profile

Advanced

Re: Collapsing Empty Variables in Nginx Access Log When Using TAB Delimiter

March 09, 2012 12:23PM
What I've done for now is replace the lines at 675 and 676 of (src/http/modules/ngx_http_log_module.c):

674: if (value == NULL || value->not_found) {
675: *buf = '-';
676: return buf + 1;
677: }

with:

674: if (value == NULL || value->not_found) {
675: *buf = 0;
676: return buf;
677: }

I hope this won't cause any issues. It seems to be working very nicely. Here's a see one-liner if anyone is interested in doing the same thing:

sed -n '1h;1!H;${;g;s/buf = \W-\W;\(\s*return buf\) + 1;/buf = 0;\1;/g;p;}' src/http/modules/ngx_http_log_module.c > src/http/modules/ngx_http_log_module.c.new && mv -f src/http/modules/ngx_http_log_module.c.new src/http/modules/ngx_http_log_module.c

It would be nice in the future to be able to set the "NULL" character for the log module.
Subject Author Posted

Collapsing Empty Variables in Nginx Access Log When Using TAB Delimiter

adamchal March 06, 2012 02:00PM

Re: Collapsing Empty Variables in Nginx Access Log When Using TAB Delimiter

Maxim Dounin March 06, 2012 04:18PM

Re: Collapsing Empty Variables in Nginx Access Log When Using TAB Delimiter

adamchal March 07, 2012 05:14PM

Re: Collapsing Empty Variables in Nginx Access Log When Using TAB Delimiter

adamchal March 08, 2012 05:14PM

Re: Collapsing Empty Variables in Nginx Access Log When Using TAB Delimiter

adamchal March 09, 2012 12:23PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 155
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