Possible issue with is_enabled and elastalert-test-rule command #1228
-
trying to test a rule before I enable it so I set is_enabled to false and when i run elastalert-test-rule against the rule im getting
I took a rule that i know work and passes with flying colors with elastalert-test-rule and than added Looking to see if im overlooking anything but seems like an issue, also noticed that the is_enabled is not defined anywhere in the schema file either. I see one other discussion that mentioned having the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The
So you have an awkward scenario here, where your telling a helper tool to do something that doesn't make sense. Ideally, ElastAlert 2 would show a more graceful error that you're doing something that isn't possible, but currently it aborts with a stack trace. If you're interested in submitting a PR to make it more gracefully exit, you are welcome to do so. The contributing guidelines document specifies requirements for submissions. |
Beta Was this translation helpful? Give feedback.
The
is_enabled
flag is used by ElastAlert 2's initialization stage to separate rules into an enabled list, and a disabled list. Rules in the disabled list do not get fully initialized. Later during the scheduling loop, the enabled list of rules get run on each scheduled cycle.elastalert-test-rule
uses that same initialization logic, which detects that the rule is disabled. However, since you are telling the script "RUN THIS RULE!" via the command line arguments, it bypasses the scheduling logic and immediately runs the specified rule. Yet the rule was not properly initialized because it's marked as a disabled rule.So you have an awkward scenario here, where your telling a helper tool to…