# Howto use buckets\_path for percentiles metric aggregation?

**URL:** <https://discuss.elastic.co/t/howto-use-buckets-path-for-percentiles-metric-aggregation/37985>\
**Category:** Elasticsearch\
**Created:** [December 26, 2015, 3:23pm UTC](https://discuss.elastic.co/t/howto-use-buckets-path-for-percentiles-metric-aggregation/37985 "2015-12-26T15:23:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chenryn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chenryn/32/44917_2.png) [@chenryn](https://discuss.elastic.co/u/chenryn)\
**Post date:** [December 26, 2015, 3:23pm UTC](https://discuss.elastic.co/t/howto-use-buckets-path-for-percentiles-metric-aggregation/37985/1 "2015-12-26T15:23:12Z")

</div>

Percentiles metric aggregtaion returns a multi-value result. And I know I can write `buckets_path` for multi-value like `bucketsname.metricname`.

But, the key of percentiles metric agg result is named like `50.0`, `90.0`, those also use DOT!

I try to forget the `.0`, and find something other more interesting:

Here is my request:

```auto
{
  "aggs" : {
    "my_date_histo" : {
      "date_histogram" : {
        "field" : "@timestamp",
        "interval" : "1h"
      },
      "aggs" : {
        "pcttime" : {
        "percentiles" : { "field" : "num_field" }
        },
        "the_movavg45" : {
          "moving_avg" : {
            "buckets_path" : "pcttime.45",
            "window" : 10,
            "model" : "simple"
          }
        },
        "the_movavg55" : {
          "moving_avg" : {
            "buckets_path" : "pcttime.55",
            "window" : 10,
            "model" : "simple"
          }
        },
        "the_movavg50" : {
          "moving_avg" : {
            "buckets_path" : "pcttime.50",
            "window" : 10,
            "model" : "simple"
          }
        }
      }
    }
  }
}

```

I use two NOT-EXISTS key (45, 55), but also got the response:

```auto
"aggregations" : {
    "my_date_histo" : {
      "buckets" : [ {
        "key_as_string" : "2015-12-24T02:00:00.000Z",
        "key" : 1450922400000,
        "doc_count" : 1462,
        "pcttime" : {
          "values" : {
            "1.0" : 8.61,
            "5.0" : 50.0,
            "25.0" : 259.7801169590643,
            "50.0" : 506.6208791208792,
            "75.0" : 752.2619047619047,
            "95.0" : 946.6333333333332,
            "99.0" : 994.0
          }
        }
      }, {
        "key_as_string" : "2015-12-24T03:00:00.000Z",
        "key" : 1450926000000,
        "doc_count" : 13077,
        "pcttime" : {
          "values" : {
            "1.0" : 10.25333333333333,
            "5.0" : 52.61263736263737,
            "25.0" : 253.4788589832068,
            "50.0" : 501.97747099662007,
            "75.0" : 752.0346378551421,
            "95.0" : 949.8349473684209,
            "99.0" : 988.0
          }
        },
        "the_movavg45" : {
          "value" : 466.2075
        },
        "the_movavg55" : {
          "value" : 564.8130952380953
        },
        "the_movavg50" : {
          "value" : 506.6208791208792
        }
      }, {
...

```

There are no 45, 55 in `pcttime.values` of percentiles metric aggregation. How can the pipeline got the value of pcttime.45, pcttime.55?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:28pm UTC](https://discuss.elastic.co/t/howto-use-buckets-path-for-percentiles-metric-aggregation/37985/2 "2017-07-05T23:28:24Z")

</div>


