Hello, i'm new to syslog-ng and recently compiled and installed it (version 1.9.4) on my system (LFS, Kernel 2.6.11.7). The problem i have is that even with the default configuiration file it claims to have syntax errors. The lines causing the errors are: destination user { file("/var/log/user.log"); }; and filter f_auth { facility(auth); }; Whereas the first problem is generated due to the fact the the identifier is called "user". If i call it "user_" it works fine. With the second line the problem is "auth" because facility(authpriv) is accepted. But why not auth?! I'm really at a loss with that. I hope someone here has an idea what might be the problem. Thanks in advance. Regards, J. Meub
On Thu, 05 May 2005 18:01:11 +0200, "J. Meub" said:
Whereas the first problem is generated due to the fact the the identifier is called "user". If i call it "user_" it works fine. With the second line the problem is "auth" because facility(authpriv) is accepted. But why not auth?!
From /usr/include/sys/syslog.h on my Linux box: /* facility codes */ #define LOG_KERN (0<<3) /* kernel messages */ #define LOG_USER (1<<3) /* random user-level messages */ #define LOG_MAIL (2<<3) /* mail system */ #define LOG_DAEMON (3<<3) /* system daemons */ #define LOG_AUTH (4<<3) /* security/authorization messages */ #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ #define LOG_LPR (6<<3) /* line printer subsystem */ #define LOG_NEWS (7<<3) /* network news subsystem */ #define LOG_UUCP (8<<3) /* UUCP subsystem */ #define LOG_CRON (9<<3) /* clock daemon */ #define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */ #define LOG_FTP (11<<3) /* ftp daemon */ Note that user, auth, and authpriv are all facility codes. You can probably guess the rest of the dont-call-them-that list. Oh, and I omitted local0-local7 to save space.....
Valdis.Kletnieks@vt.edu schrieb:
From /usr/include/sys/syslog.h on my Linux box:
/* facility codes */ #define LOG_KERN (0<<3) /* kernel messages */ #define LOG_USER (1<<3) /* random user-level messages */ #define LOG_MAIL (2<<3) /* mail system */ #define LOG_DAEMON (3<<3) /* system daemons */ #define LOG_AUTH (4<<3) /* security/authorization messages */ #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ #define LOG_LPR (6<<3) /* line printer subsystem */ #define LOG_NEWS (7<<3) /* network news subsystem */ #define LOG_UUCP (8<<3) /* UUCP subsystem */ #define LOG_CRON (9<<3) /* clock daemon */ #define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */ #define LOG_FTP (11<<3) /* ftp daemon */
It looks the same on my system.
On Thu, 2005-05-05 at 18:01 +0200, J. Meub wrote:
Hello,
i'm new to syslog-ng and recently compiled and installed it (version 1.9.4) on my system (LFS, Kernel 2.6.11.7). The problem i have is that even with the default configuiration file it claims to have syntax errors. The lines causing the errors are: destination user { file("/var/log/user.log"); }; and filter f_auth { facility(auth); };
I've tried this configuration file: source s_udp { unix-stream("log" log_iw_size(5)); udp(port(2000)); internal(); }; destination d_file { file("/home/bazsi/zwa/install/syslog-ng-2.0/messages" template("/var/log/messages/$HOST/$FACILITY.log\n") log_fifo_size(10)); }; destination user { file("user.log"); }; filter f_auth { facility(auth); }; log { source(s_udp); destination(d_file); destination(user); flags(flow-control); }; It was parsed fine. -- Bazsi
Balazs Scheidler schrieb:
I've tried this configuration file:
source s_udp { unix-stream("log" log_iw_size(5)); udp(port(2000)); internal(); };
destination d_file { file("/home/bazsi/zwa/install/syslog-ng-2.0/messages" template("/var/log/messages/$HOST/$FACILITY.log\n") log_fifo_size(10)); }; destination user { file("user.log"); };
filter f_auth { facility(auth); };
log { source(s_udp); destination(d_file); destination(user); flags(flow-control); };
It was parsed fine.
On my system this gives: gateway:/etc # syslog-ng syntax error at 4 So again the problem with naming a destination "user". Any ideas? Regards, J. Meub
On Thu, 2005-05-05 at 21:19 +0200, J. Meub wrote:
Balazs Scheidler schrieb:
I've tried this configuration file:
source s_udp { unix-stream("log" log_iw_size(5)); udp(port(2000)); internal(); };
destination d_file { file("/home/bazsi/zwa/install/syslog-ng-2.0/messages" template("/var/log/messages/$HOST/$FACILITY.log\n") log_fifo_size(10)); }; destination user { file("user.log"); };
filter f_auth { facility(auth); };
log { source(s_udp); destination(d_file); destination(user); flags(flow-control); };
It was parsed fine.
On my system this gives:
gateway:/etc # syslog-ng syntax error at 4
So again the problem with naming a destination "user".
try compiling syslog-ng with YYDEBUG in CPPFLAGS and run syslog-ng with --yydebug option and send the output. -- Bazsi
Balazs Scheidler schrieb:
On my system this gives:
gateway:/etc # syslog-ng syntax error at 4
So again the problem with naming a destination "user".
try compiling syslog-ng with YYDEBUG in CPPFLAGS and run syslog-ng with --yydebug option and send the output.
Starting parse Entering state 0 Reading a token: Next token is token KW_SOURCE () Shifting token KW_SOURCE, Entering state 1 Reading a token: Next token is token IDENTIFIER () Shifting token IDENTIFIER, Entering state 10 Reducing stack by rule 239 (line 819), IDENTIFIER -> string Stack now 0 1 Entering state 13 Reading a token: Next token is token '{' () Shifting token '{', Entering state 26 Reading a token: Next token is token KW_UNIX_STREAM () Shifting token KW_UNIX_STREAM, Entering state 72 Reading a token: Next token is token '(' () Shifting token '(', Entering state 151 Reading a token: Next token is token STRING () Shifting token STRING, Entering state 11 Reducing stack by rule 240 (line 820), STRING -> string Stack now 0 1 13 26 72 151 Entering state 231 Reducing stack by rule 40 (line 296), -> @5 Stack now 0 1 13 26 72 151 231 Entering state 322 Reading a token: Next token is token KW_LOG_IW_SIZE () Shifting token KW_LOG_IW_SIZE, Entering state 328 Reading a token: Next token is token '(' () Shifting token '(', Entering state 400 Reading a token: Next token is token NUMBER () Shifting token NUMBER, Entering state 465 Reading a token: Next token is token ')' () Shifting token ')', Entering state 530 Reducing stack by rule 84 (line 411), KW_LOG_IW_SIZE '(' NUMBER ')' -> source_reader_option Stack now 0 1 13 26 72 151 231 322 Entering state 396 Reducing stack by rule 48 (line 317), source_reader_option -> source_afunix_option Stack now 0 1 13 26 72 151 231 322 Entering state 394 Reading a token: Next token is token ')' () Reducing stack by rule 43 (line 309), -> source_afunix_options Stack now 0 1 13 26 72 151 231 322 394 Entering state 462 Reducing stack by rule 42 (line 308), source_afunix_option source_afunix_options -> source_afunix_options Stack now 0 1 13 26 72 151 231 322 Entering state 393 Reducing stack by rule 41 (line 295), string @5 source_afunix_options -> source_afunix_stream_params Stack now 0 1 13 26 72 151 Entering state 230 Next token is token ')' () Shifting token ')', Entering state 321 Reducing stack by rule 35 (line 277), KW_UNIX_STREAM '(' source_afunix_stream_params ')' -> source_afsocket Stack now 0 1 13 26 Entering state 81 Reducing stack by rule 25 (line 242), source_afsocket -> source_item Stack now 0 1 13 26 Entering state 78 Reading a token: Next token is token ';' () Shifting token ';', Entering state 157 Reading a token: Next token is token KW_UDP () Shifting token KW_UDP, Entering state 74 Reading a token: Next token is token '(' () Shifting token '(', Entering state 153 Reducing stack by rule 49 (line 322), -> @6 Stack now 0 1 13 26 78 157 74 153 Entering state 235 Reading a token: Next token is token KW_PORT () Shifting token KW_PORT, Entering state 337 Reading a token: Next token is token '(' () Shifting token '(', Entering state 409 Reading a token: Next token is token NUMBER () Shifting token NUMBER, Entering state 477 Reading a token: Next token is token ')' () Shifting token ')', Entering state 541 Reducing stack by rule 58 (line 345), KW_PORT '(' NUMBER ')' -> source_afinet_option Stack now 0 1 13 26 78 157 74 153 235 Entering state 340 Reducing stack by rule 53 (line 337), source_afinet_option -> source_afinet_udp_option Stack now 0 1 13 26 78 157 74 153 235 Entering state 339 Reading a token: Next token is token ')' () Reducing stack by rule 52 (line 333), -> source_afinet_udp_options Stack now 0 1 13 26 78 157 74 153 235 339 Entering state 410 Reducing stack by rule 51 (line 332), source_afinet_udp_option source_afinet_udp_options -> source_afinet_udp_options Stack now 0 1 13 26 78 157 74 153 235 Entering state 338 Reducing stack by rule 50 (line 322), @6 source_afinet_udp_options -> source_afinet_udp_params Stack now 0 1 13 26 78 157 74 153 Entering state 234 Next token is token ')' () Shifting token ')', Entering state 325 Reducing stack by rule 36 (line 278), KW_UDP '(' source_afinet_udp_params ')' -> source_afsocket Stack now 0 1 13 26 78 157 Entering state 81 Reducing stack by rule 25 (line 242), source_afsocket -> source_item Stack now 0 1 13 26 78 157 Entering state 78 Reading a token: Next token is token ';' () Shifting token ';', Entering state 157 Reading a token: Next token is token KW_INTERNAL () Shifting token KW_INTERNAL, Entering state 69 Reading a token: Next token is token '(' () Shifting token '(', Entering state 148 Reading a token: Next token is token ')' () Shifting token ')', Entering state 225 Reducing stack by rule 27 (line 247), KW_INTERNAL '(' ')' -> source_afinter Stack now 0 1 13 26 78 157 78 157 Entering state 79 Reducing stack by rule 23 (line 240), source_afinter -> source_item Stack now 0 1 13 26 78 157 78 157 Entering state 78 Reading a token: Next token is token ';' () Shifting token ';', Entering state 157 Reading a token: Next token is token '}' () Reducing stack by rule 22 (line 236), -> source_items Stack now 0 1 13 26 78 157 78 157 78 157 Entering state 240 Reducing stack by rule 21 (line 235), source_item ';' source_items -> source_items Stack now 0 1 13 26 78 157 78 157 Entering state 240 Reducing stack by rule 21 (line 235), source_item ';' source_items -> source_items Stack now 0 1 13 26 78 157 Entering state 240 Reducing stack by rule 21 (line 235), source_item ';' source_items -> source_items Stack now 0 1 13 26 Entering state 77 Next token is token '}' () Shifting token '}', Entering state 156 Reducing stack by rule 10 (line 196), string '{' source_items '}' -> source_stmt Stack now 0 1 Entering state 12 Reducing stack by rule 4 (line 187), KW_SOURCE source_stmt -> stmt Stack now 0 Entering state 9 Reading a token: Next token is token ';' () Shifting token ';', Entering state 25 Reading a token: Next token is token KW_DESTINATION () Shifting token KW_DESTINATION, Entering state 2 Reading a token: Next token is token IDENTIFIER () Shifting token IDENTIFIER, Entering state 10 Reducing stack by rule 239 (line 819), IDENTIFIER -> string Stack now 0 9 25 2 Entering state 15 Reading a token: Next token is token '{' () Shifting token '{', Entering state 27 Reading a token: Next token is token KW_FILE () Shifting token KW_FILE, Entering state 83 Reading a token: Next token is token '(' () Shifting token '(', Entering state 158 Reading a token: Next token is token STRING () Shifting token STRING, Entering state 11 Reducing stack by rule 240 (line 820), STRING -> string Stack now 0 9 25 2 15 27 83 158 Entering state 242 Reducing stack by rule 101 (line 447), -> @9 Stack now 0 9 25 2 15 27 83 158 242 Entering state 357 Reading a token: Next token is token KW_TEMPLATE () Shifting token KW_TEMPLATE, Entering state 436 Reading a token: Next token is token '(' () Shifting token '(', Entering state 505 Reading a token: Next token is token STRING () Shifting token STRING, Entering state 11 Reducing stack by rule 240 (line 820), STRING -> string Stack now 0 9 25 2 15 27 83 158 242 357 436 505 Entering state 567 Reading a token: Next token is token ')' () Shifting token ')', Entering state 598 Reducing stack by rule 158 (line 620), KW_TEMPLATE '(' string ')' -> dest_writer_option Stack now 0 9 25 2 15 27 83 158 242 357 Entering state 440 Reducing stack by rule 105 (line 462), dest_writer_option -> dest_affile_option Stack now 0 9 25 2 15 27 83 158 242 357 Entering state 439 Reading a token: Next token is token KW_LOG_FIFO_SIZE () Shifting token KW_LOG_FIFO_SIZE, Entering state 427 Reading a token: Next token is token '(' () Shifting token '(', Entering state 496 Reading a token: Next token is token NUMBER () Shifting token NUMBER, Entering state 556 Reading a token: Next token is token ')' () Shifting token ')', Entering state 588 Reducing stack by rule 156 (line 618), KW_LOG_FIFO_SIZE '(' NUMBER ')' -> dest_writer_option Stack now 0 9 25 2 15 27 83 158 242 357 439 Entering state 440 Reducing stack by rule 105 (line 462), dest_writer_option -> dest_affile_option Stack now 0 9 25 2 15 27 83 158 242 357 439 Entering state 439 Reading a token: Next token is token ')' () Reducing stack by rule 104 (line 458), -> dest_affile_options Stack now 0 9 25 2 15 27 83 158 242 357 439 439 Entering state 507 Reducing stack by rule 103 (line 457), dest_affile_option dest_affile_options -> dest_affile_options Stack now 0 9 25 2 15 27 83 158 242 357 439 Entering state 507 Reducing stack by rule 103 (line 457), dest_affile_option dest_affile_options -> dest_affile_options Stack now 0 9 25 2 15 27 83 158 242 357 Entering state 438 Reducing stack by rule 102 (line 446), string @9 dest_affile_options -> dest_affile_params Stack now 0 9 25 2 15 27 83 158 Entering state 241 Next token is token ')' () Shifting token ')', Entering state 356 Reducing stack by rule 100 (line 442), KW_FILE '(' dest_affile_params ')' -> dest_affile Stack now 0 9 25 2 15 27 Entering state 93 Reducing stack by rule 95 (line 434), dest_affile -> dest_item Stack now 0 9 25 2 15 27 Entering state 92 Reading a token: Next token is token ';' () Shifting token ';', Entering state 167 Reading a token: Next token is token '}' () Reducing stack by rule 94 (line 430), -> dest_items Stack now 0 9 25 2 15 27 92 167 Entering state 256 Reducing stack by rule 93 (line 429), dest_item ';' dest_items -> dest_items Stack now 0 9 25 2 15 27 Entering state 91 Next token is token '}' () Shifting token '}', Entering state 166 Reducing stack by rule 11 (line 200), string '{' dest_items '}' -> dest_stmt Stack now 0 9 25 2 Entering state 14 Reducing stack by rule 5 (line 188), KW_DESTINATION dest_stmt -> stmt Stack now 0 9 25 Entering state 9 Reading a token: Next token is token ';' () Shifting token ';', Entering state 25 Reading a token: Next token is token KW_DESTINATION () Shifting token KW_DESTINATION, Entering state 2 Reading a token: Next token is token KW_USER () syntax error at 4 Error: popping token KW_DESTINATION () Stack now 0 9 25 9 25 Error: popping token ';' () Stack now 0 9 25 9 Error: popping nterm stmt () Stack now 0 9 25 Error: popping token ';' () Stack now 0 9 Error: popping nterm stmt () Stack now 0 Regards, J. Meub
On Fri, 2005-05-06 at 12:28 +0200, J. Meub wrote:
Balazs Scheidler schrieb:
On my system this gives:
gateway:/etc # syslog-ng syntax error at 4
So again the problem with naming a destination "user".
try compiling syslog-ng with YYDEBUG in CPPFLAGS and run syslog-ng with --yydebug option and send the output.
Reading a token: Next token is token ';' () Shifting token ';', Entering state 25 Reading a token: Next token is token KW_DESTINATION () Shifting token KW_DESTINATION, Entering state 2 Reading a token: Next token is token KW_USER () ^^^^^^^
That's strange, the KW_USER keyword corresponds to a string named "usertty" and not "user": bazsi@bzorp:~/zwa/work/syslog-ng-2.0/syslog-ng/src$ grep KW_USER cfg-lex.l { "usertty", KW_USER }, -- Bazsi
Balazs Scheidler schrieb:
That's strange, the KW_USER keyword corresponds to a string named "usertty" and not "user":
bazsi@bzorp:~/zwa/work/syslog-ng-2.0/syslog-ng/src$ grep KW_USER cfg-lex.l { "usertty", KW_USER },
Looks exactly the same here: suud@gateway:/packages/src/syslog-ng-1.9.4/src> grep KW_USER cfg-lex.l { "usertty", KW_USER }, Regards, J. Meub
On Fri, 2005-05-06 at 13:09 +0200, J. Meub wrote:
Balazs Scheidler schrieb:
That's strange, the KW_USER keyword corresponds to a string named "usertty" and not "user":
bazsi@bzorp:~/zwa/work/syslog-ng-2.0/syslog-ng/src$ grep KW_USER cfg-lex.l { "usertty", KW_USER },
Looks exactly the same here:
suud@gateway:/packages/src/syslog-ng-1.9.4/src> grep KW_USER cfg-lex.l { "usertty", KW_USER },
I've committed a fix for this problem, which should appear in tomorrow's snapshot. -- Bazsi
Balazs Scheidler schrieb:
try compiling syslog-ng with YYDEBUG in CPPFLAGS and run syslog-ng with --yydebug option and send the output.
Reading a token: Next token is token ';' () Shifting token ';', Entering state 25 Reading a token: Next token is token KW_DESTINATION () Shifting token KW_DESTINATION, Entering state 2 Reading a token: Next token is token KW_USER ()
^^^^^^^
This is what happens if i comment out the line containing "user" so it reaches filter f_auth { facility(auth); }; [...] Reading a token: Next token is token ';' () Shifting token ';', Entering state 25 Reading a token: Next token is token KW_FILTER () Shifting token KW_FILTER, Entering state 5 Reading a token: Next token is token IDENTIFIER () Shifting token IDENTIFIER, Entering state 10 Reducing stack by rule 239 (line 819), IDENTIFIER -> string Stack now 0 9 25 9 25 5 Entering state 21 Reading a token: Next token is token '{' () Shifting token '{', Entering state 66 Reading a token: Next token is token KW_FACILITY () Shifting token KW_FACILITY, Entering state 139 Reading a token: Next token is token '(' () Shifting token '(', Entering state 211 Reading a token: Next token is token KW_AUTH () syntax error at 6 Error: popping token '(' () Stack now 0 9 25 9 25 5 21 66 139 Error: popping token KW_FACILITY () Stack now 0 9 25 9 25 5 21 66 Error: popping token '{' () Stack now 0 9 25 9 25 5 21 Error: popping nterm string () Stack now 0 9 25 9 25 5 Error: popping token KW_FILTER () Stack now 0 9 25 9 25 Error: popping token ';' () Stack now 0 9 25 9 Error: popping nterm stmt () Stack now 0 9 25 Error: popping token ';' () Stack now 0 9 Error: popping nterm stmt () Stack now 0 Regards, J. Meub
participants (3)
-
Balazs Scheidler
-
J. Meub
-
Valdis.Kletnieks@vt.edu