Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]change rule has logic error when the compare_key is boolean #925

Closed
anjia0532 opened this issue Mar 3, 2017 · 0 comments · Fixed by #938
Closed

[BUG]change rule has logic error when the compare_key is boolean #925

anjia0532 opened this issue Mar 3, 2017 · 0 comments · Fixed by #938

Comments

@anjia0532
Copy link
Contributor

anjia0532 commented Mar 3, 2017

I use Heartbeat monitor my service . and alert by change rule.

query_key: monitor
compare_key: up
ignore_null: true

but the Heartbeat's up field is Boolean value 。so...
https://github.com/Yelp/elastalert/blob/master/elastalert/ruletypes.py#L135

...
 def compare(self, event):
        key = hashable(lookup_es_key(event, self.rules['query_key']))
        val = lookup_es_key(event, self.rules['compare_key'])
        if not val and self.rules['ignore_null']:
            return False
...

when the service down

up is false. not val is true and because of the ignore_null is true.

so always return False not run compare code

anjia0532 added a commit to anjia0532/elastalert that referenced this issue Mar 8, 2017
Qmando pushed a commit that referenced this issue Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant