From a9c31fa4c656311197d195e193e1f7238c9920e0 Mon Sep 17 00:00:00 2001 From: Quentin Long Date: Thu, 23 Apr 2015 13:41:07 -0700 Subject: [PATCH] Added until to silence_mapping --- config.yaml.example | 2 +- elastalert/create_index.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.yaml.example b/config.yaml.example index 7d8ce5340..862e8f523 100644 --- a/config.yaml.example +++ b/config.yaml.example @@ -28,7 +28,7 @@ es_port: 14900 # The index on es_host which is used for metadata storage # This can be a unmapped index, but it is reccommended that you run -# tools/create_index.py to set a mapping +# elastalert-create-index to set a mapping writeback_index: elastalert_status # If an alert fails for some reason, ElastAlert will retry diff --git a/elastalert/create_index.py b/elastalert/create_index.py index b42ba94e8..da2ef4229 100644 --- a/elastalert/create_index.py +++ b/elastalert/create_index.py @@ -44,7 +44,8 @@ def main(): es = Elasticsearch(host=host, port=port, use_ssl=use_ssl, http_auth=http_auth) - silence_mapping = {'silence': {'properties': {'rule_name': {'index': 'not_analyzed', 'type': 'string'}}}} + silence_mapping = {'silence': {'properties': {'rule_name': {'index': 'not_analyzed', 'type': 'string'}, + 'until': {'type': 'date', 'format': 'dateOptionalTime'}}}} ess_mapping = {'elastalert_status': {'properties': {'rule_name': {'index': 'not_analyzed', 'type': 'string'}, '@timestamp': {'format': 'dateOptionalTime', 'type': 'date'}}}} es_mapping = {'elastalert': {'properties': {'rule_name': {'index': 'not_analyzed', 'type': 'string'},