﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
596	Условие при логировании в syslog	Oleksandr Typlyns'kyi		"В документации [http://nginx.org/r/access_log/ru access_log] для syslog заявлена возможность использовать условие.
Указываю в конфиге:
access_log syslog:server=unix:/var/run/log,facility=local5 main if=$loggable;
Получаю ошибку:
nginx: [emerg] parameter ""if=$loggable"" is not supported by syslog

Насколько я понял по коду ngx_http_log_handler, конфликтов у filter с syslog быть не должно.
В качестве быстрого патча сделал исключение для ""if="" и ещё один goto:

{{{
--- src/http/modules/ngx_http_log_module.c.orig 2014-07-08 16:22:39.000000000 +0300
+++ src/http/modules/ngx_http_log_module.c      2014-07-28 15:09:29.621933289 +0300
@@ -1256,6 +1256,23 @@ process_formats:

     if (log->syslog_peer != NULL) {
         if (cf->args->nelts > 3) {
+            if (cf->args->nelts == 4) {
+                if (ngx_strncmp(value[3].data, ""if="", 3) == 0) {
+                    filter.len = value[3].len - 3;
+                    filter.data = value[3].data + 3;
+                    goto process_filter;
+               } else {
+                    ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                                       ""parameter \""%V\"" is not supported by syslog"",
+                                       &value[3]);
+                    return NGX_CONF_ERROR;
+                }
+            } else {
+                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                                   ""parameter \""%V\"" is not supported by syslog"",
+                                   &value[4]);
+                return NGX_CONF_ERROR;
+            }
             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                                ""parameter \""%V\"" is not supported by syslog"",
                                &value[3]);
@@ -1410,6 +1427,8 @@ process_formats:
         log->file->data = buffer;
     }

+process_filter:
+
     if (filter.len) {
         log->filter = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
         if (log->filter == NULL) {
}}}

"	defect	closed	minor		nginx-module	1.7.x	fixed	ngx_http_log_module			"nginx version: nginx/1.7.3
configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-file-aio --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-http_dav_module --add-module=/usr/ports/www/nginx-devel/work/arut-nginx-dav-ext-module-0e07a3e --with-http_flv_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_stub_status_module --with-http_sub_module --with-pcre
"
