Summarize elasticsearch data over the time

This might be a use case for Elasticsearch Watcher. You don't need to create an application, just do all the logic within the cluster.