The effect of run_every and buffer_time are not consistent #1632
-
The elastalert2/elastalert/elastalert.py Line 739 in f55421b elastalert2/elastalert/elastalert.py Line 748 in f55421b elastalert2/elastalert/elastalert.py Line 599 in f55421b I think we can set the rule['run_every'] and rule['buffer_time'] to have the default value from the global config at the first place and make the rest of the codes always reference rule instead of self to make it consistent. This can also benefit other modules that have a rule context, like Enhancements.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I believe you are correct with respect to There's also a known issue with rules not defaulting to a If you're up for submitting a PR the contributing guidelines are documented here in the CONTRIBUTING.md file. |
Beta Was this translation helpful? Give feedback.
I believe you are correct with respect to
run_every
but I don't see wherebuffer_time
is also affected by this problem. It looks like all references tobuffer_time
already use the rule's value, but can fallback to the global value if the rule hasn't defined it. If you're suggesting only that the logic could be changed to not use thebuffer_time
fallback logic throughout the code and instead only do that during the rule init phase then I would agree that is a better approach.There's also a known issue with rules not defaulting to a
realert
value defined at the global config level, and instead each requires its own explicit realert setting. So it would be nice to see both vars cleaned up t…