[syslog-ng] [Bug 128] template() broken in latest 3.3 git

Balazs Scheidler bazsi at balabit.hu
Fri Jul 22 11:03:24 CEST 2011


Hi,

On Wed, 2011-07-20 at 15:55 +0100, Nix wrote:
> 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).
> 

It works for me:

PASS: test_template

The error messages indicate that your test suite couldn't load the
"basicfuncs" plugin that contains an implementation for $(if) $(grep)
and $(echo)

> 
> 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 at 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 at esperi.org.uk>

Right, thanks, I've noticed this too, right before reading your email.
Also pushed.

-- 
Bazsi




More information about the syslog-ng mailing list