diff options
author | Sébastien Determe <sd378r@intl.att.com> | 2018-03-21 14:16:00 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-03-21 14:16:00 +0000 |
commit | 8a8231745a39b0d8eb8cfb6a37ec0e34fa302e5d (patch) | |
tree | 38499cef7e977e03a992be7ad10818cf61bda3f5 /extra/docker/elk/tools/EsAutoQuery/timeSince.json | |
parent | 01c83cc95099f220fd91bbe2e838c7049f514f54 (diff) | |
parent | 5082fd7ed2037dfdb9c37ae60b77bc3165262663 (diff) |
Merge "Adding CLAMP Dashboard"
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 000000000..6ee14933d --- /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" + } + } + + } +} |