Skip to content

Commit 47670d3

Browse files
committed
filter expert: treat filter_regex false as False
if the parameter filter_regex: false was set, the bot treated this as true with this patch, false is treated as false
1 parent 4855ef9 commit 47670d3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#### Experts
3535
- `intelmq.bots.experts.sieve.expert`:
3636
- For `:contains`, `=~` and `!~`, convert the value to string before matching avoiding an exception. If the value is a dict, convert the value to JSON (PR#2500 by Sebastian Wagner).
37+
- `intelmq.bots.experts.filter.expert`:
38+
- Treat value `false` for parameter `filter_regex` as false (PR#2499 by Sebastian Wagner).
3739

3840
#### Outputs
3941
- `intelmq.bots.outputs.misp.output_feed`: Handle failures if saved current event wasn't saved or is incorrect (PR by Kamil Mankowski).

intelmq/bots/experts/filter/expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def init(self):
6464
self.filter = False
6565

6666
self.regex = False
67-
if self.filter_regex is not None:
67+
if self.filter_regex:
6868
self.regex = re.compile(self.filter_value)
6969

7070
self.time_filter = self.not_after is not None or self.not_before is not None

0 commit comments

Comments
 (0)