Hi All,
I am trying to limit to the bucket count in the aggregation results and below is the query I am using,
GET metricbeat_0/_search
{
   "query": {
      "range": {
         "timestamp": {
            "gte": "2017-09-29 17:57:04.437",
            "lte": "2017-12-07 09:16:44.399"
         }
      }
   },
   "aggs": {
      "bucket_time": {
         "date_histogram": {
            "field": "timestamp",
            "interval": "5m",
            "order": {
               "_key": "desc"
            }
         },
         "aggs": {
            "server_stats": {
               "avg": {
                  "field": "metricbeat_system_process_memory_size"
               }
            }
         }
      }
   }
}
I want to limit the size of the bucket count and for ex:- If I defined the size: 10 the bucket should only contains ten records.
How to limit the bucket count in the above query?
Please kindly share your thoughts.
Thanks,
Ganeshbabu R