# Is this possible to refer multiple buckets\_path in \`moving\_fn\` aggregation?

**URL:** <https://discuss.elastic.co/t/is-this-possible-to-refer-multiple-buckets-path-in-moving-fn-aggregation/219101>\
**Category:** Elasticsearch\
**Created:** [February 13, 2020, 1:11am UTC](https://discuss.elastic.co/t/is-this-possible-to-refer-multiple-buckets-path-in-moving-fn-aggregation/219101 "2020-02-13T01:11:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![seyoongit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seyoongit/32/62589_2.png) [@seyoongit](https://discuss.elastic.co/u/seyoongit)\
**Post date:** [February 13, 2020, 1:11am UTC](https://discuss.elastic.co/t/is-this-possible-to-refer-multiple-buckets-path-in-moving-fn-aggregation/219101/1 "2020-02-13T01:11:17Z")

</div>

official doc introduces `moving_fn` syntax as below.

```
{
    "moving_fn": {
        "buckets_path": "the_sum",
        "window": 10,
        "script": "MovingFunctions.min(values)"
    }
}

```

then, is this possible to refer multiple buckets like below?

```
"moving_fn": {
    "buckets_path": {
        "foo": "foo",
        "bar": "bar"
    },
    "window": 10,
    "script": "MovingFunctions.sum(params.foo.values) + MovingFunctions.sum(params.bar.values)"
}

```

It seems not works. I got an Error like below

> [moving\_fn] buckets\_path doesn't support values of type: START\_OBJECT"

but I wanna confirm centainly this isn't possible. thanks in advance

---

<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:** [March 12, 2020, 1:12am UTC](https://discuss.elastic.co/t/is-this-possible-to-refer-multiple-buckets-path-in-moving-fn-aggregation/219101/2 "2020-03-12T01:12:39Z")

</div>

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