Yelp / elastalert

Easy & Flexible Alerting With ElasticSearch
https://elastalert.readthedocs.org
Apache License 2.0
8k stars 1.73k forks source link

Option to buffer internal state of rules to disk #75

Open eastebry opened 9 years ago

eastebry commented 9 years ago

The current state of each rule is currently stored in memory, which it loses whenever it restarts.

It would be nice to allow the rules to write state to elastic search or to disk so it can gracefully resume whenever it restarts.

Qmando commented 9 years ago

For existing rules, this probably only need to save the contents of the event windows, ie self.occurences and self.cur/ref_window.

I think a good way to do this is have a global option to save state at a given time interval, overridable per rule.

RuleTypes should have an optional method for serializing their state data.