summaryrefslogtreecommitdiffstats
path: root/extra/docker/elk/tools/EsAutoQuery/closedLoopAlarmDuration.json
diff options
context:
space:
mode:
authorSébastien Determe <sd378r@intl.att.com>2018-03-21 14:16:00 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-21 14:16:00 +0000
commit8a8231745a39b0d8eb8cfb6a37ec0e34fa302e5d (patch)
tree38499cef7e977e03a992be7ad10818cf61bda3f5 /extra/docker/elk/tools/EsAutoQuery/closedLoopAlarmDuration.json
parent01c83cc95099f220fd91bbe2e838c7049f514f54 (diff)
parent5082fd7ed2037dfdb9c37ae60b77bc3165262663 (diff)
Merge "Adding CLAMP Dashboard"
Diffstat (limited to 'extra/docker/elk/tools/EsAutoQuery/closedLoopAlarmDuration.json')
-rw-r--r--extra/docker/elk/tools/EsAutoQuery/closedLoopAlarmDuration.json34
1 files changed, 34 insertions, 0 deletions
diff --git a/extra/docker/elk/tools/EsAutoQuery/closedLoopAlarmDuration.json b/extra/docker/elk/tools/EsAutoQuery/closedLoopAlarmDuration.json
new file mode 100644
index 000000000..5a295454b
--- /dev/null
+++ b/extra/docker/elk/tools/EsAutoQuery/closedLoopAlarmDuration.json
@@ -0,0 +1,34 @@
+{
+ "query" : {
+ "bool": {
+ "must": [
+ { "match": { "closedLoopEventStatus": "ABATED" } }
+ ]
+ }
+ },
+ "script_fields" : {
+ "closedLoopAlarmDuration" : {
+ "script" : {
+ "lang": "painless",
+ "source": "
+if (doc.get('closedLoopEventStatus.keyword').value == 'ABATED') {
+ return doc.get('closedLoopAlarmEnd').value - doc.get('closedLoopAlarmStart').value;
+}
+return null
+"
+ }
+ }
+ , "closedLoopAlarmStart" : {
+ "script" : {
+ "lang": "painless",
+ "source": "doc['closedLoopAlarmStart']"
+ }
+ }
+ , "closedLoopAlarmEnd" : {
+ "script" : {
+ "lang": "painless",
+ "source": "doc['closedLoopAlarmEnd']"
+ }
+ }
+ }
+}