Commit 120b5dc8 authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Generalize template parameter name

parent 10818c26
...@@ -22,7 +22,7 @@ md5sum = 5784bea3bd608913769ff9a8afcccb68 ...@@ -22,7 +22,7 @@ md5sum = 5784bea3bd608913769ff9a8afcccb68
[profile-frontend] [profile-frontend]
filename = instance-frontend.cfg.in filename = instance-frontend.cfg.in
md5sum = 80175cd9f3ae3c6feccbc0bdbad399fe md5sum = 204ea7abf93694cf3b0f1a08dcd57256
[profile-master] [profile-master]
filename = instance-master.cfg.in filename = instance-master.cfg.in
...@@ -106,7 +106,7 @@ md5sum = 40fe46a1fe653406b18ca46351d195b8 ...@@ -106,7 +106,7 @@ md5sum = 40fe46a1fe653406b18ca46351d195b8
[template-backend-haproxy-rsyslogd-conf] [template-backend-haproxy-rsyslogd-conf]
_update_hash_filename_ = templates/backend-haproxy-rsyslogd.conf.in _update_hash_filename_ = templates/backend-haproxy-rsyslogd.conf.in
md5sum = 3336d554661b138dcef97b1d1866803c md5sum = ba91b7778c3d730353d42d7804ef8050
[template-slave-introspection-httpd-nginx] [template-slave-introspection-httpd-nginx]
_update_hash_filename_ = templates/slave-introspection-httpd-nginx.conf.in _update_hash_filename_ = templates/slave-introspection-httpd-nginx.conf.in
......
...@@ -887,7 +887,7 @@ log-file = ${directory:log}/backend-haproxy.log ...@@ -887,7 +887,7 @@ log-file = ${directory:log}/backend-haproxy.log
pid-file = ${directory:run}/backend-haproxy-rsyslogd.pid pid-file = ${directory:run}/backend-haproxy-rsyslogd.pid
spool-directory = ${directory:backend-haproxy-rsyslogd-spool} spool-directory = ${directory:backend-haproxy-rsyslogd-spool}
graceful-command = kill -HUP $(cat ${:pid-file}) graceful-command = kill -HUP $(cat ${:pid-file})
caddy-log-directory = ${caddy-directory:slave-log} log-directory = ${caddy-directory:slave-log}
[backend-haproxy-rsyslogd-configuration] [backend-haproxy-rsyslogd-configuration]
<= jinja2-template-base <= jinja2-template-base
......
...@@ -19,7 +19,7 @@ $WorkDirectory {{ configuration['spool-directory'] }} ...@@ -19,7 +19,7 @@ $WorkDirectory {{ configuration['spool-directory'] }}
{%- set regex = ".*-backend (.*)-http.{0,1}(|-failover)/" %} {%- set regex = ".*-backend (.*)-http.{0,1}(|-failover)/" %}
template(name="extract_slave_name" type="string" string="%msg:R,ERE,1,FIELD:{{ regex }}--end%") template(name="extract_slave_name" type="string" string="%msg:R,ERE,1,FIELD:{{ regex }}--end%")
set $!slave_name = exec_template("extract_slave_name"); set $!slave_name = exec_template("extract_slave_name");
template(name="slave_output" type="string" string="{{ configuration['caddy-log-directory'] }}/%$!slave_name%_backend_log") template(name="slave_output" type="string" string="{{ configuration['log-directory'] }}/%$!slave_name%_backend_log")
if (re_match($msg, "{{ regex }}")) then { if (re_match($msg, "{{ regex }}")) then {
action(type="omfile" dynaFile="slave_output") action(type="omfile" dynaFile="slave_output")
stop stop
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment