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

Allow run_every to be unique per rule #2593

Merged
merged 3 commits into from
Jan 28, 2020
Merged

Allow run_every to be unique per rule #2593

merged 3 commits into from
Jan 28, 2020

Conversation

Qmando
Copy link
Member

@Qmando Qmando commented Dec 5, 2019

Fixes #497

It's currently copying run_every as part of the "default rule properties", which used to be a set of things that are not configurable by the rule yaml itself. This was never removed despite run_every becoming a per rule property.

Several tests were relying on this because they are mocking out the config loader, which also adds a default run_every, and not specifying one.

I added a test for specifically this feature, and confirmed that without the changes to elastalert.py, that new test fails.

As a bonus, I've included a fix for #2580, because I haven't created a separate PR for it yet. This allows nested query keys to work in top_count_keys.

Also note: I also added a pin for elasticsearch==7.0.0, because apparently 7.1.0 will NOT work with ES < 6.6 due to it not supported _source_include(s?). 7.0.0 does. Tests won't pass otherwise.

@ghost
Copy link

ghost commented Jan 27, 2020

@Qmando is there any blocker for this PR to be merged?

@danielpops danielpops self-requested a review January 28, 2020 01:22
@Qmando Qmando merged commit 1334b61 into master Jan 28, 2020
@ghost
Copy link

ghost commented Jan 28, 2020

@Qmando thank you, sir! 🎉

@moix
Copy link

moix commented Apr 19, 2020

Hi, does the restriction of elasticsearch==7.0.0 means we cannot run against any other el version? I have a cluster in 7.5.1 so initially was forcing the elasticsearch library to 7.5.1 but after upgrading elastalert to 0.2.4 it fails.
Thanks!

@Qmando
Copy link
Member Author

Qmando commented Apr 20, 2020

What does "it fails" mean exactly

@moix
Copy link

moix commented Apr 20, 2020

requirements are set to force elasticsearch==7.0.0 so it complains if I have 7.5.1

@Qmando
Copy link
Member Author

Qmando commented Apr 21, 2020

Try $ python -m elastalert.elastalert instead of $ elastalert

I'm not sure exactly what conditions cause this but I think it's certain versions of setuptools (or pip? idk) create a link (the elastalert binary) that force all packages to match exactly.

Could you share the exact error message so I can narrow it down? I can't reproduce that problem.

@moix
Copy link

moix commented Apr 21, 2020

yep that did the trick indeed, thanks didn't know about differences how python libs are checked 👍

@rashmichoudhary07
Copy link

@Qmando
So is allow run_every to be unique per rule working now? i tried it at my end, but it still considers the run_every from config.yaml only for all my rules.

Please help!
Thanks

@MakoWish
Copy link

MakoWish commented Oct 9, 2020

+1 looking for this feature to work.

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 this pull request may close these issues.

How to specify different run_every: values on rules
6 participants