Hi,
I have a stream keep feeding elasticsearch for the following events:
POST /test_index/test_type/_bulk {"index":{"_id":"1"}} {"timestamp": "2015/07/22 08:00:00", "host": "www.google.com", "hits": 100} {"index":{"_id":"2"}} {"timestamp": "2015/07/22 08:01:00", "host": "www.google.com", "hits": 20} {"index":{"_id":"3"}} {"timestamp": "2015/07/22 08:02:00", "host": "www.facebook.com", "hits": 200} {"index":{"_id":"4"}} {"timestamp": "2015/07/22 08:03:00", "host": "www.yahoo.com", "hits": 80}
i.e., each document contains timestamp, host and hits.
I'm trying to figure out how to use percolator to build an alerting so that it's triggered when the following conditions are met:
- During the past 5 minutes, any host's average hits exceeds 100;
- During the past 10 minutes, the difference between the max hits and the min hits for host www.google.com exceeds 50.
This specific use case is hypothetical, but in general what I'm looking for are:
- How can I build a percolator with aggregations? The percolator documents indicate it's possible but I didn't find any examples.
- How can I pass multiple documents to a percolator? All existing examples just pass a single document to a percolator, but the alerting conditions for my case requires aggregations across multiple documents.
- As a variation of #2, is it possible to pass multiple existing indexed documents to a percolator?
It would be appreciated if anyone can shed some light on this.
Thanks,
Frank