# Kibana 5.4 bucket\_script visualization

**URL:** <https://discuss.elastic.co/t/kibana-5-4-bucket-script-visualization/86475>\
**Category:** Kibana\
**Created:** [May 19, 2017, 5:58pm UTC](https://discuss.elastic.co/t/kibana-5-4-bucket-script-visualization/86475 "2017-05-19T17:58:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kazark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kazark/32/18378_2.png) [@Kazark](https://discuss.elastic.co/u/Kazark)\
**Post date:** [May 19, 2017, 5:58pm UTC](https://discuss.elastic.co/t/kibana-5-4-bucket-script-visualization/86475/1 "2017-05-19T17:58:58Z")

</div>

I can run this query through the Dev Tools in Kibana 5.4, but I cannot find any way to build a visualization off it:

```
{
  "query": {
    "constant_score": {
      "filter": {
        "match": {
          "activitytype": "pickPut"
        }
      }
    }
  },
  "aggs": {
    "byName": {
      "terms": {
        "field": "username.keyword",
        "size": 10
      },
      "aggs": {
        "total_picks": {
          "sum": {
            "field": "quantity"
          }
        },
        "total_loggedin_time": {
          "sum": {
            "field": "durationInSeconds"
          }
        },
        "computeRatio": {
          "bucket_script": {
            "buckets_path": {
              "picks": "total_picks",
              "time": "total_loggedin_time"
            },
            "script": "params.picks / params.time * 3600"
          }
        }
      }
    }
  }
}

```

I cannot figure out how to create a bucket script aggregation through Kibana 5.4, despite the inclusion of pipeline aggregations. This is a little confusing given that there is a [request](https://github.com/elastic/kibana/issues/4707) for it on GitHub, which is closed a dupe of the pipelines aggregation [feature request](https://github.com/elastic/kibana/issues/4584), but in the description of why that was closed, it does not seem that the pipeline aggregations that were implemented include the bucket script one.

Am I understanding rightly that there is no way to visualize this query in Kibana 5.4?

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [May 19, 2017, 9:36pm UTC](https://discuss.elastic.co/t/kibana-5-4-bucket-script-visualization/86475/2 "2017-05-19T21:36:04Z")

</div>

I agree, I've reopened the ticket.

---

<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:** [June 16, 2017, 9:36pm UTC](https://discuss.elastic.co/t/kibana-5-4-bucket-script-visualization/86475/3 "2017-06-16T21:36:06Z")

</div>

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