On 20 Jul 2011, Balazs Scheidler said:
This patch finally makes both work for me:
This causes test_template to fail: FAIL: error compiling template, template=$(echo $HOST $PID), error=Unknown template function echo FAIL: error compiling template, template=$(echo "$(echo $HOST)" $PID), error=Unknown template function echo FAIL: error compiling template, template=$(echo "$(echo '$(echo $HOST)')" $PID), error=Unknown template function echo FAIL: error compiling template, template=$(echo "$(echo '$(echo $HOST)')" $PID), error=Unknown template function echo FAIL: error compiling template, template=$(echo '"$(echo $(echo $HOST))"' $PID), error=Unknown template function echo FAIL: error compiling template, template=$(ipv4-to-int $SOURCEIP), error=Unknown template function ipv4-to-int FAIL: error compiling template, template=$(grep 'facility(local3)' $PID), error=Unknown template function grep FAIL: error compiling template, template=$(grep 'facility(local3)' $PID $PROGRAM), error=Unknown template function grep FAIL: error compiling template, template=$(grep 'facility(local4)' $PID), error=Unknown template function grep FAIL: error compiling template, template=$(grep ('$FACILITY' == 'local4') $PID), error=Unknown template function grep FAIL: error compiling template, template=$(grep ('$FACILITY(' == 'local3(') $PID), error=Unknown template function grep FAIL: error compiling template, template=$(grep ('$FACILITY(' == 'local4)') $PID), error=Unknown template function grep FAIL: error compiling template, template=$(grep \'$FACILITY\'\ ==\ \'local4\' $PID), error=Unknown template function grep FAIL: error compiling template, template=$(if 'facility(local4)' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if 'facility(local3)' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY" lt "local3"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY" le "local3"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY" eq "local3"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY" ne "local3"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY" gt "local3"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY" ge "local3"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY_NUM" < "19"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY_NUM" <= "19"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY_NUM" == "19"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY_NUM" != "19"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY_NUM" > "19"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY_NUM" >= "19"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY_NUM" >= "19" and "kicsi" == "nagy"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(if '"$FACILITY_NUM" >= "19" or "kicsi" == "nagy"' alma korte), error=Unknown template function if FAIL: error compiling template, template=$(echo ${HOST}@0 ${PID}@1), error=Unknown template function echo FAIL: error compiling template, template=$(echo $HOST $PID)@0, error=Unknown template function echo FAIL: error compiling template, template=$(grep 'facility(local3)' $PID)@0, error=Unknown template function grep FAIL: error compiling template, template=$(grep 'facility(local3)' $PID)@1, error=Unknown template function grep FAIL: error compiling template, template=$(grep 'facility(local3)' $PID)@2, error=Unknown template function grep FAIL: error compiling template, template=dani $(echo $HOST $DATE $(echo huha)) balint, error=Unknown template function echo WARNING: template: the default value for template-escape is changing to 'no' in version 3.0, please update your configuration file accordingly; WARNING: template: the meaning of the $MSG/$MESSAGE macros is changing in version 3.0, please prepend a $MSGHDR when upgrading to 3.0 config format; FAIL: test_template Not installing on the grounds that this is probably a bad sign (but it may be a testsuite error, I suppose). Also, you missed a call site, so the csvparser module won't compile anymore. Here's a patch, which does things the same way you did them in cfg-grammar.y, and which compiles, at least:
From 5b18af42d417f47ceae2ac1526cc572182394210 Mon Sep 17 00:00:00 2001 From: Nix <nix@esperi.org.uk> Date: Wed, 20 Jul 2011 15:51:55 +0100 Subject: [PATCH] Fix compilation of the CSV parser module.
Commit 091f4c093b4836114badc8a7a4863bdac8757f42 changed the prototype of cfg_check_inline_template(): adjust the CSV parser module's use of this function accordingly. Signed-off-by: Nick Alcock <nix@esperi.org.uk> --- modules/csvparser/csvparser-grammar.ym | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/csvparser/csvparser-grammar.ym b/modules/csvparser/csvparser-grammar.ym index 90f1438..5ab0ea1 100644 --- a/modules/csvparser/csvparser-grammar.ym +++ b/modules/csvparser/csvparser-grammar.ym @@ -80,10 +80,10 @@ parser_column_opt parser_opt : KW_TEMPLATE '(' string ')' { - LogTemplate *template = cfg_check_inline_template(configuration, $3); GError *error = NULL; + LogTemplate *template = cfg_check_inline_template(configuration, $3, error); - CHECK_ERROR(log_template_compile(template, $3, &error), @3, "Error compiling template (%s)", error->message); + CHECK_ERROR(template != NULL, @3, "Error compiling template (%s)", error->message); log_parser_set_template(last_parser, template); free($3); } -- 1.7.5.4.136.g9db10