diff options
-rw-r--r-- | doc/log_rotation_fix_size.html | 2 | ||||
-rw-r--r-- | doc/rsyslog_conf_output.html | 2 | ||||
-rw-r--r-- | grammar/grammar.y | 1 | ||||
-rw-r--r-- | grammar/lexer.l | 3 | ||||
-rw-r--r-- | tools/omfile.c | 8 |
5 files changed, 13 insertions, 3 deletions
diff --git a/doc/log_rotation_fix_size.html b/doc/log_rotation_fix_size.html index 190b24cb..51edf033 100644 --- a/doc/log_rotation_fix_size.html +++ b/doc/log_rotation_fix_size.html @@ -34,7 +34,7 @@ Channels to achieve this. Putting the following directive</p> # outchannel definiation $outchannel log_rotation,/var/log/log_rotation.log, 52428800,/home/me/./log_rotation_script # activate the channel and log everything to it -*.* $log_rotation +*.* :omfile:$log_rotation # end log rotation via outchannel </pre></p> diff --git a/doc/rsyslog_conf_output.html b/doc/rsyslog_conf_output.html index c52aaa5e..426f2f27 100644 --- a/doc/rsyslog_conf_output.html +++ b/doc/rsyslog_conf_output.html @@ -49,7 +49,7 @@ does not activate it. To do so, you must use a selector line (see below). That selector line includes the channel name plus an $ sign in front of it. A sample might be:<br> <br> -*.* $mychannel<br> +*.* :omfile:$mychannel<br> <br> In its current form, output channels primarily provide the ability to size-limit an output file. To do so, specify a maximum size. When this diff --git a/grammar/grammar.y b/grammar/grammar.y index b8790411..402b1a57 100644 --- a/grammar/grammar.y +++ b/grammar/grammar.y @@ -63,6 +63,7 @@ extern int yyerror(char*); %token ENDOBJ %token <s> CFSYSLINE %token BEGIN_ACTION +%token STOP %token <s> LEGACY_ACTION %token <s> PRIFILT %token <s> PROPFILT diff --git a/grammar/lexer.l b/grammar/lexer.l index 347a2a7a..802b2d89 100644 --- a/grammar/lexer.l +++ b/grammar/lexer.l @@ -134,6 +134,7 @@ int fileno(FILE *stream); /* line number support because the "preprocessor" combines lines and so needs * to tell us the real source line. */ +"stop" { dbgprintf("STOP\n"); return STOP; } "preprocfilelinenumber(" { BEGIN LINENO; } <LINENO>[0-9]+ { yylineno = atoi(yytext) - 1; } <LINENO>")" { BEGIN INITIAL; } @@ -159,7 +160,7 @@ int fileno(FILE *stream); \-\/[^*][^\n]* | \/[^*][^\n]* | :[a-z0-9]+:[^\n]* | -[\|\.\-\@~][^\n]+ | +[\|\.\-\@\^?~>][^\n]+ | [a-z0-9_][a-z0-9_\-\+]* { yylval.s = strdup(yytext); // printf("lex: LEGA ACT: '%s'\n", yytext); return LEGACY_ACTION; } diff --git a/tools/omfile.c b/tools/omfile.c index b50a36ab..8ecfc302 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -712,6 +712,14 @@ ENDdoAction BEGINparseSelectorAct CODESTARTparseSelectorAct + /* Note: the indicator sequence permits us to use '$' to signify + * outchannel, what otherwise is not possible due to truely + * unresolvable grammar conflicts (*this time no way around*). + * rgerhards, 2011-07-09 + */ + if(!strncmp((char*) p, ":omfile:", sizeof(":omfile:") - 1)) { + p += sizeof(":omfile:") - 1; + } if(!(*p == '$' || *p == '?' || *p == '/' || *p == '.' || *p == '-')) ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); |