Skip to content

datetime.now() gives the correct time only once in an enhancement module #448

Closed Locked Answered by jertel
K0WALSKl asked this question in Q&A
Discussion options

You must be logged in to vote

You are permanently modifying the rule's alert_text value. The first time it runs the process() method it is replacing the ##1## and ##2## strings with the timestamps. Now, every subsequent alert's process() invocation will look at the same rule alert_text but no longer find a ##1## or ##2##. This is because you just modified the original rule itself, instead of the match data.

Make sure you understand the difference between the rule dict and the match dict.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@K0WALSKl
Comment options

Answer selected by K0WALSKl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants