jertel / elastalert2

ElastAlert 2 is a continuation of the original yelp/elastalert project. Pull requests are appreciated!
https://elastalert2.readthedocs.org
Apache License 2.0
895 stars 282 forks source link

Add functionality to read rules from a folder #1236

Closed mehrdad-khojastefar closed 1 year ago

mehrdad-khojastefar commented 1 year ago

Description

The problem I tried to solve was organizing our rules in my workplace, we had so many rules and maintaining them was getting kind of hard. The solution was somewhat simple, the rules configMap needed to be updated so that it reads from a folder and scans all files with .yaml extension and build the rules configMap from them. I hope this feature helps you too because now our rules are much more cleaner and maintainable. Thanks for this awesome project as well.

with this feature all rules can be in its own folder and you just need to pass the folder name to the rootRulesFolder in the values.yaml

Checklist

Questions or Comments

I am waiting for your comments, if everything is ok then I can write the documentation and etc. for this PR.

jertel commented 1 year ago

Thanks for the submission! I don't see a reason not to include this so please proceed with documentation and changelog updates. Also, I think your PR accidentally included changes to default values, and some formatting changes. Please revert those since they don't appear to be part of your new feature.

mehrdad-khojastefar commented 1 year ago

Thanks for the comment. Really looking forward to contribute more! I've updated the chart's readme and changelog. Also I reverted the formatting of values.yaml file. I've double checked the changes and tested them once more and everything seems ok .