Skip to content

Commit 76efdb6

Browse files
Merge pull request syslog-ng#5016 from therandomstring/filter-sev-numeric-fix
Add numeric value setting to level filter
2 parents 688b449 + 8a0b80e commit 76efdb6

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

lib/filter/filter-expr-grammar.ym

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ filter_simple_expr
146146
: KW_FACILITY '(' filter_fac_list ')' { $$ = filter_facility_new($3); }
147147
| KW_FACILITY '(' LL_NUMBER ')' { $$ = filter_facility_new(0x80000000 | $3); }
148148
| KW_SEVERITY '(' filter_severity_list ')' { $$ = filter_severity_new($3); }
149+
| KW_SEVERITY '(' LL_NUMBER ')' { $$ = filter_severity_new( 1 << $3); }
149150
| KW_FILTER '(' string ')' { $$ = filter_call_new($3, configuration); free($3); }
150151
| KW_NETMASK '(' string ')' { $$ = filter_netmask_new($3); free($3); }
151152
| KW_NETMASK6 '(' string ')' {

news/feature-5016.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
`filter`: Added numerical severity settings.
2+
3+
The `level` filter option now accepts numerical values similar to `facility`.
4+
5+
Example config:
6+
```
7+
filter f_severity {
8+
level(4)
9+
};
10+
```
11+
This is equivalent to
12+
```
13+
filter f_severity {
14+
level("warning")
15+
};
16+
```
17+
18+
For more information, consult the [documentation](https://syslog-ng.github.io/admin-guide/080_Log/030_Filters/005_Filter_functions/004_level_priority.html).

0 commit comments

Comments
 (0)