Welcome! Log In Create A New Profile

Advanced

Can not use $bytes_sent in module (complex values)

Benjamin Grössing
September 18, 2012 09:58AM
Hello,

I am currently working on a nginx module, that parses user defined
strings for variables using ngx_http_complex_value_t. That works great
with all variables defined in ngx_http_variables.c (i.e.
$body_bytes_sent). However, variables as $bytes_sent do not exist here
since ngx_http_log_module uses its own variable parsing system. What
is the best way to use these extra variables in my module? I have
thought of the following options, I am not very sure about what is the
best way to go:
a) Copy the ngx_http_log_module code in my own module and rename every
single type and function to avoid double definitions. Reuse functions
and types from there.
b) Move the ngx_http_log_module code in my own module directory and
compile it only there. Reuse functions and types from there.
c) Write own variable parsing system, reuse a few snippets from
ngx_http_variables and ngx_http_log_module, whatever fits best.
d) Use complex values and try to extend the ngx_http_core_variables
array to include $body_bytes_sent and the other missing variables (I
don't understand why they are not included here anyway?).
e) Any better way to achieve that?

I'd really appreciate your help.

Regards
Benjamin

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

Can not use $bytes_sent in module (complex values)

Benjamin Grössing 1148 September 18, 2012 09:58AM

Re: Can not use $bytes_sent in module (complex values)

Vladimir Shebordaev 484 September 18, 2012 11:58AM

Re: Can not use $bytes_sent in module (complex values)

Maxim Dounin 455 September 18, 2012 08:08PM

Re: Can not use $bytes_sent in module (complex values)

Benjamin Grössing 421 September 19, 2012 05:14PM

Re: Can not use $bytes_sent in module (complex values)

Maxim Dounin 457 September 20, 2012 04:06AM

Re: Can not use $bytes_sent in module (complex values)

Vladimir Shebordaev 529 September 19, 2012 07:44PM

Re: Can not use $bytes_sent in module (complex values)

Maxim Dounin 486 September 20, 2012 03:54AM

Re: Can not use $bytes_sent in module (complex values)

Vladimir Shebordaev 444 September 21, 2012 04:18AM

Re: Can not use $bytes_sent in module (complex values) Attachments

Benjamin Grössing 511 September 27, 2012 11:32AM

Re: Can not use $bytes_sent in module (complex values)

Vladimir Shebordaev 476 September 30, 2012 12:20AM

Re: Can not use $bytes_sent in module (complex values)

Maxim Dounin 529 October 03, 2012 11:30AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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