From 0b91f8ab3204669de188b1ef4eb91f6554139443 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 1 Dec 2014 23:07:52 +0100 Subject: es5: histogram agg and avg clients work now --- src/es5/es-query.json | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/es5/es-query.json b/src/es5/es-query.json index 0db2cfb..6fdfb81 100644 --- a/src/es5/es-query.json +++ b/src/es5/es-query.json @@ -1,20 +1,24 @@ { - "aggregations": - { - "by_source": - { - "terms": { "script": "[ doc['hostname'].value, doc['streamer-id.content-id'].value, doc['streamer-id.format'].value, doc['streamer-id.quality'].value ].join('/') ", - "size": 0 - } + "aggregations": { + "timeslots": { + "date_histogram": { + "field": "start-time", + "interval": "1h" }, - "the_total_time": - { - "sum": { "field": "duration-ms" } - }, - "avg_clients": - { - "avg": { "field": "data.client-count" } + "aggregations": { + "by_source": { + "terms": { + "script": "[ doc['hostname'].value, doc['streamer-id.content-id'].value, doc['streamer-id.format'].value, doc['streamer-id.quality'].value ].join('/') ", + "size": 0 + }, + "aggregations": { + "avg_clients": { + "avg": { "field": "data.client-count" } + } + } + } } + } } } -- cgit v1.2.3