OSE 3.4(.1) block() argument parse issue
syslog-ng OSE 3.4.1 is unable to parse the "Example 5.8: Passing arguments to blocks" excerpt in the v3.4 admin guide, which exemplifies a common construct used in our current 3.2 config : @version: 3.4 block source s_logfile (filename("messages")) { file("/var/log/`filename`" ); }; source s_example { s_logfile(filename("logfile.log")); }; host# ./syslog-ng -s -f ./s2.conf : Error parsing affile, syntax error, unexpected LL_IDENTIFIER in source block s_logfile at line 2, column 19: included from /home/eberggren/proj/syslog-ng/config/s2.conf line 7, column 36 file("/var/log/"logfile.log ^^^^^^^^^^^ 3.3.8 appears to be okay with it, however (and our existing 3.2 config). thanks, -eric
Hi! Eric Berggren <eric_berggren@apple.com> writes:
syslog-ng OSE 3.4.1 is unable to parse the "Example 5.8: Passing arguments to blocks" excerpt in the v3.4 admin guide, which exemplifies a common construct used in our current 3.2 config :
@version: 3.4
block source s_logfile (filename("messages")) { file("/var/log/`filename`" ); }; source s_example { s_logfile(filename("logfile.log")); };
host# ./syslog-ng -s -f ./s2.conf :
Error parsing affile, syntax error, unexpected LL_IDENTIFIER in source block s_logfile at line 2, column 19: included from /home/eberggren/proj/syslog-ng/config/s2.conf line 7, column 36
file("/var/log/"logfile.log ^^^^^^^^^^^
3.3.8 appears to be okay with it, however (and our existing 3.2 config).
Until the problem is properly fixed, dropping the quotes around the filename appears to be a reasonable workaround: block source s_logfile (filename(messages)) { file("/var/log/`filename`" ); }; source s_example { s_logfile(filename(logfile.log)); }; Not that great, but this works in both 3.3 and 3.4 (I have not tested 3.2, but I suspect that'd work too). -- |8]
Eric Berggren <eric_berggren@apple.com> writes:
syslog-ng OSE 3.4.1 is unable to parse the "Example 5.8: Passing arguments to blocks" excerpt in the v3.4 admin guide, which exemplifies a common construct used in our current 3.2 config :
I've pushed a fix[1] to the hotfix/3.4/string-in-string-block-args branch of my repo[2], which works around the problem. I'm pretty sure this is not the best solution, and the proper one would be somewhere in the lexer or grammar rules, but I don't have much more time to spend on this right now. [1]: https://github.com/algernon/syslog-ng/commit/229b389ab452267fca573dd48984165... [2]: https://github.com/algernon/syslog-ng/tree/hotfix/3.4/string-in-string-block... -- |8]
participants (2)
-
Eric Berggren
-
Gergely Nagy