summaryrefslogtreecommitdiff
path: root/src/es5/es-query.json
blob: b51f3f785dc23022e6777986ca16b8a787a070eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
  "query": {
    "range": {
      "start-time": {
        "gte": "2014-10-23T19:30:00.000",
        "lt": "2014-10-23T23:00:00.000",
        "time_zone": "+2:00"
      }
    }
  },
  "aggregations": {
    "timeslots": {
      "date_histogram": {
        "field": "start-time",
        "interval": "5m"
      },
      "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": {
            "clients": {
              "stats": { "field": "data.client-count" }
            }
          }
        }
      }
    }
  }
}