{
  "size": 0,
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "clusterPhyId": {
              "value": %d
            }
          }
        },
        {
          "range": {
            "timestamp": {
              "gte": %d,
              "lte": %d
            }
          }
        }
      ]
    }
  },
  "aggs": {
      %s
   }
}