# Would Kibana5 support pipeline aggregations?

**URL:** <https://discuss.elastic.co/t/would-kibana5-support-pipeline-aggregations/56707>\
**Category:** Kibana\
**Created:** [July 29, 2016, 8:31am UTC](https://discuss.elastic.co/t/would-kibana5-support-pipeline-aggregations/56707 "2016-07-29T08:31:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morriaty](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@Morriaty](https://discuss.elastic.co/u/Morriaty)\
**Post date:** [July 29, 2016, 8:31am UTC](https://discuss.elastic.co/t/would-kibana5-support-pipeline-aggregations/56707/1 "2016-07-29T08:31:39Z")

</div>

Hi

Timelion helps us a lot for calculating and plotting time series data, but the shortage is that X-axis can only be time series.

So when we do some calculations like this, neither Kibana nor timelion works.

![gongshi](https://latex.codecogs.com/gif.latex?%5Cfrac%7Bcount%28filter%28A+B%29%29%5C%20group%5C%20by%5C%20field%5C%20C%7D%7Bcount%28filter%28A%29%29%5C%20group%5C%20by%5C%20field%5C%20C%7D)

This is a division between two `terms aggregation`, and the X-axis should be `field C`. As I know, pipeline aggregation can solve this problem, but I found it not supported with current version of Kibana.

Also, I'd like to know whether it's difficult to develop a new Kibana plugin based on timelion to solve this problem?

Thank you for help!

---

<div class="post-metadata">

**Author:** ![simianhacker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simianhacker/32/3383_2.png) [@simianhacker](https://discuss.elastic.co/u/simianhacker)\
**Post date:** [July 29, 2016, 3:04pm UTC](https://discuss.elastic.co/t/would-kibana5-support-pipeline-aggregations/56707/2 "2016-07-29T15:04:05Z")

</div>

We don't have any plans for adding pipeline aggregations to Visualize ☹ (but we are exploring some new interfaces but there is no timeline for when that will be ready).

As a side note... For Pipeline Aggs you will also either need to have the x-axis be either a `histogram` or `date_histogram` due the the nature of how most pipeline aggs. work. Have you tied to express your equation in pipeline aggs in Sense? Is field C a number?

---

<div class="post-metadata">

**Author:** ![Morriaty](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@Morriaty](https://discuss.elastic.co/u/Morriaty)\
**Post date:** [August 1, 2016, 3:53am UTC](https://discuss.elastic.co/t/would-kibana5-support-pipeline-aggregations/56707/3 "2016-08-01T03:53:37Z")

</div>

Hi @simianhacker ,

Field C is not numeric, so the x-axis would be `terms aggregation`.

I have tried to write the dsl, but have problems with `buckets_path`

```auto
{
  "size": 0,
  "aggs": {
    "test": {
      "filters": {
        "filters": {
          "A": {
            # ...
          },
          "B": {
            # ...
          }
        }
      },
      "aggs": {
        "groupby": {
          "terms": {
            "field": "session.column2",
            "size": 10
          }
        },
        "ratio": {
          "bucket_script": {
            "buckets_path": {
              "FA": "A>groupby", # No aggregation found for path [A>groupby]
              "FB": "B>groupby" # No aggregation found for path [B>groupby]
            },
            "script": "FA / FB * 100"
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Morriaty](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@Morriaty](https://discuss.elastic.co/u/Morriaty)\
**Post date:** [August 1, 2016, 7:53am UTC](https://discuss.elastic.co/t/would-kibana5-support-pipeline-aggregations/56707/4 "2016-08-01T07:53:35Z")

</div>

Hi @simianhacker  
I've corrected my dsl, but still with problem of sorting.

```auto
{
  "size": 0,
  "aggregations": {
    "session_id": {
      "terms": {
        "field": "session.column2",
        "order": {
          "ratio": "desc" # Error!
        }
      },
      "aggregations": {
        "A": {
          "filter": {
            # ...
          }
        },
        "B": {
          "filter": {
            # ...
          }
        },
        "ratio": {
          "bucket_script": {
            "buckets_path": {
              "FA": "A._count",
              "FB": "B._count"
            },
            "script": "FA / (FB + 1) * 100.0"
          }
        }
      }
    }
  }
}

```

I tried to order by sub-aggs, but raised error:

```auto
Invalid term-aggregator order path [ratio]. Unknown aggregation [ratio]

```

---

<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 6, 2017, 1:42pm UTC](https://discuss.elastic.co/t/would-kibana5-support-pipeline-aggregations/56707/5 "2017-07-06T13:42:54Z")

</div>


