Aggregator [load_time_outlier] of type [percentiles] cannot accept sub-aggregations

i use percentiles aggregation for the response times low25% mid50% top25% partitions and then want to get min/max values based on each aggregated partitions. i try to write query like

GET myindex-2020.06/_search
{
  "size": 0,
    "aggs": {
        "MY_FILTER" : {
            "filter" : {
              "bool": {
                "must": [
                  {
                    "term": { "project_type.raw": "PROJECT1"}
                  },
                  {
                    "term": { "log_type.raw": "RESPONSE"}
                  }
                ]
              }
            },
        "aggs": {
        "daily": {
          "date_histogram": {
            "field": "@timestamp",
            "interval": "1d"
          },
          "aggs": {
            "load_time_outlier": {
              "percentiles": {
                "field": "elapsed_time",
                "percents": [ 1, 25, 75]
              },
              
              "aggs" : {
                "min_value" : { 
                  "min" : {  "field" : "load_time_outlier" } 
                }
              }
            }
          }
        }
      } 
    }
  }
}

but i got error response msg

    {
      "error": {
        "root_cause": [
          {
            "type": "aggregation_initialization_exception",
            "reason": "Aggregator [load_time_outlier] of type [percentiles] cannot accept sub-aggregations"
          }
        ],
        "type": "aggregation_initialization_exception",
        "reason": "Aggregator [load_time_outlier] of type [percentiles] cannot accept sub-aggregations"
      },
      "status": 500
    }

is percentiles not possible to sub-aggregations? or is my query something wrong?
please help :pray:

Percentiles aggregation is a metric aggregation and therefore it does not support sub-aggregations.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.