Skip to content

Commit

Permalink
Merge pull request syslog-ng#5016 from therandomstring/filter-sev-num…
Browse files Browse the repository at this point in the history
…eric-fix

Add numeric value setting to level filter
  • Loading branch information
therandomstring authored Jul 22, 2024
2 parents 688b449 + 8a0b80e commit 76efdb6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/filter/filter-expr-grammar.ym
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ filter_simple_expr
: KW_FACILITY '(' filter_fac_list ')' { $$ = filter_facility_new($3); }
| KW_FACILITY '(' LL_NUMBER ')' { $$ = filter_facility_new(0x80000000 | $3); }
| KW_SEVERITY '(' filter_severity_list ')' { $$ = filter_severity_new($3); }
| KW_SEVERITY '(' LL_NUMBER ')' { $$ = filter_severity_new( 1 << $3); }
| KW_FILTER '(' string ')' { $$ = filter_call_new($3, configuration); free($3); }
| KW_NETMASK '(' string ')' { $$ = filter_netmask_new($3); free($3); }
| KW_NETMASK6 '(' string ')' {
Expand Down
18 changes: 18 additions & 0 deletions news/feature-5016.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
`filter`: Added numerical severity settings.

The `level` filter option now accepts numerical values similar to `facility`.

Example config:
```
filter f_severity {
level(4)
};
```
This is equivalent to
```
filter f_severity {
level("warning")
};
```

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 comments on commit 76efdb6

Please sign in to comment.