From eb8fad8f58adcb477a5c7c65c58451201677a5a5 Mon Sep 17 00:00:00 2001 From: Phrozyn Date: Tue, 7 Aug 2018 15:48:52 -0500 Subject: [PATCH] Adding index to initial es event, and updating mapping. --- cron/healthAndStatus.py | 2 +- cron/mozdefStateMappingTemplate.json | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cron/healthAndStatus.py b/cron/healthAndStatus.py index 5af5d8e3..a59b8ed0 100755 --- a/cron/healthAndStatus.py +++ b/cron/healthAndStatus.py @@ -134,7 +134,7 @@ def main(): # post to elastic search servers directly without going through # message queues in case there is an availability issue - es.save_event(doc_type='mozdefhealth', body=json.dumps(healthlog)) + es.save_event(index=index, doc_type='mozdefhealth', body=json.dumps(healthlog)) # post another doc with a static docid and tag # for use when querying for the latest status healthlog['tags'] = ['mozdef', 'status', 'latest'] diff --git a/cron/mozdefStateMappingTemplate.json b/cron/mozdefStateMappingTemplate.json index 1d3913c6..7fd570e4 100644 --- a/cron/mozdefStateMappingTemplate.json +++ b/cron/mozdefStateMappingTemplate.json @@ -284,6 +284,9 @@ "loadaverage": { "type": "float" }, + "username": { + "type": "keyword" + }, "queues": { "properties": { "deliver_eps": { @@ -298,6 +301,12 @@ "publish_eps": { "type": "float" }, + "messages_inflight": { + "type": "long" + }, + "messages_delayed": { + "type": "long" + }, "queue": { "type": "text", "fields": { @@ -329,15 +338,6 @@ }, "total_publish_eps": { "type": "float" - }, - "username": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } } } },