mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-19 17:20:42 +01:00
milestone: added BSD-style blocks
This commit is contained in:
parent
4598557192
commit
b966576f1e
@ -110,6 +110,10 @@ news.notice -/var/log/news/news.notice
|
||||
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
|
||||
# busy site..
|
||||
#
|
||||
!ThisTag
|
||||
+host1
|
||||
-host2
|
||||
+*
|
||||
daemon.*;mail.*;\
|
||||
news.err;\
|
||||
*.=debug;*.=info;\
|
||||
|
||||
@ -122,9 +122,10 @@ char *currfn; /* name of currently processed file */
|
||||
^[ \t]*[,\*a-z]+\.[,!=;\.\*a-z]+ { printf("token prifilt '%s'\n", yytext); yylval.s = strdup(yytext); return PRIFILT; }
|
||||
|
||||
"*" |
|
||||
\-\/[^*][^\n]* |
|
||||
\/[^*][^\n]* |
|
||||
[\|\.\-\@:~][^\n]+ |
|
||||
[a-z0-9_\-\+]+ { yylval.s = strdup(yytext); return LEGACY_ACTION; }
|
||||
[a-z0-9_][a-z0-9_\-\+]* { yylval.s = strdup(yytext); printf("LEGACY_ACT: '%s'\n", yytext);return LEGACY_ACTION; }
|
||||
<INOBJ>")" { BEGIN INITIAL; return ENDOBJ; }
|
||||
<INOBJ>[a-z][a-z0-9_\.]* { yylval.estr = es_newStrFromCStr(yytext, yyleng);
|
||||
return NAME; }
|
||||
@ -141,7 +142,6 @@ char *currfn; /* name of currently processed file */
|
||||
<INOBJ>[ \n\t]
|
||||
<INOBJ>. { printf("INOBJ: invalid char '%s'\n", yytext); }
|
||||
|
||||
/* CFSYSLINE is valid in all modes */
|
||||
\$[a-z]+.*$ { /* see common on $IncludeConfig above */
|
||||
if(!strncasecmp(yytext, "$includeconfig ", 14)) {
|
||||
yyless(14);
|
||||
@ -151,6 +151,10 @@ char *currfn; /* name of currently processed file */
|
||||
return CFSYSLINE;
|
||||
}
|
||||
}
|
||||
![^ \t\n]+[ \t]*$ { printf("BSD TAG '%s'\n", yytext); yylval.s = strdup(yytext); return BSD_TAG_SELECTOR; }
|
||||
[+-]\*[ \t\n]*#.*$ { printf("BSD HOST '%s'\n", yytext); yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; }
|
||||
[+-]\*[ \t\n]*$ { printf("BSD HOST '%s'\n", yytext); yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; }
|
||||
^[ \t]*[+-][a-z0-9.:-]+[ \t]*$ { printf("BSD HOST '%s'\n", yytext); yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; }
|
||||
|
||||
\#.*\n /* skip comments in input */
|
||||
[\n\t ] /* drop whitespace */
|
||||
|
||||
@ -27,6 +27,8 @@ extern int yylineno;
|
||||
%token <s> LEGACY_ACTION
|
||||
%token <s> PRIFILT
|
||||
%token <s> PROPFILT
|
||||
%token <s> BSD_TAG_SELECTOR
|
||||
%token <s> BSD_HOST_SELECTOR
|
||||
%token IF
|
||||
%token THEN
|
||||
%token OR
|
||||
@ -73,8 +75,10 @@ extern int yylineno;
|
||||
%%
|
||||
conf: /* empty (to end recursion) */
|
||||
| obj conf
|
||||
| cfsysline conf
|
||||
| rule conf
|
||||
| cfsysline conf
|
||||
| BSD_TAG_SELECTOR conf
|
||||
| BSD_HOST_SELECTOR conf
|
||||
|
||||
obj: BEGINOBJ nvlst ENDOBJ { $$ = cnfobjNew($1, $2);
|
||||
cnfobjPrint($$);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user