diff options
author | 2020-01-30 16:00:05 +0100 | |
---|---|---|
committer | 2020-01-30 16:56:33 +0100 | |
commit | 4abf1c966abcecfd42bcaaceeae6d2c197c69df3 (patch) | |
tree | 1ef3cd0c531faa9e47ab3373f6a83fc4539096a8 /extra/docker/elk/tools/EsAutoQuery/timeSince.json | |
parent | 96078b6156c74da9c7810f2733d6c50f69711a62 (diff) |
Dashboard initial commit
Initial commit of Dashboard based on Open Distro ES-kibana.
Issue-ID: CLAMP-483
Change-Id: Ib4a3c686696dd77ba9012424f31389307c8bb720
Signed-off-by: osgn422w <gervais-martial.ngueko@intl.att.com>
Diffstat (limited to 'extra/docker/elk/tools/EsAutoQuery/timeSince.json')
-rw-r--r-- | extra/docker/elk/tools/EsAutoQuery/timeSince.json | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/extra/docker/elk/tools/EsAutoQuery/timeSince.json b/extra/docker/elk/tools/EsAutoQuery/timeSince.json new file mode 100644 index 0000000..6ee1493 --- /dev/null +++ b/extra/docker/elk/tools/EsAutoQuery/timeSince.json @@ -0,0 +1,51 @@ +{ + "query" : { + "match_all": {} + }, + "script_fields" : { + "timeSince" : { + "script" : { + "lang": "painless", + "source": " +long now = System.currentTimeMillis(); +if (doc.get('closedLoopEventStatus.keyword').value == 'ABATED') { + return now - doc.get('closedLoopAlarmEnd').value; +} +if (doc.get('closedLoopEventStatus.keyword').value == 'ONSET') { + return now - doc.get('closedLoopAlarmStart').value; +} +if (doc.containsKey('notification.keyword')) { + return now - doc.get('notificationTime').value; +} + +return null +" + } + } + , "closedLoopAlarmStart" : { + "script" : { + "lang": "painless", + "source": "doc['closedLoopAlarmStart']" + } + } + , "closedLoopEventStatus" : { + "script" : { + "lang": "painless", + "source": "doc['closedLoopEventStatus.keyword']" + } + } + , "notification" : { + "script" : { + "lang": "painless", + "source": "doc['notification.keyword']" + } + } + , "notificationTime" : { + "script" : { + "lang": "painless", + "source": "doc['notificationTime'].value" + } + } + + } +} |