# Calling groovy script from Kibana

**URL:** <https://discuss.elastic.co/t/calling-groovy-script-from-kibana/2542>\
**Category:** Kibana\
**Created:** [June 12, 2015, 6:43am UTC](https://discuss.elastic.co/t/calling-groovy-script-from-kibana/2542 "2015-06-12T06:43:23Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [July 1, 2015, 4:47am UTC](https://discuss.elastic.co/t/calling-groovy-script-from-kibana/2542/6 "2015-07-01T04:47:27Z")

</div>

You might be looking for a [scripted metric aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-scripted-metric-aggregation.html) here, which is not supported in Kibana at this time.

To operate on ratios (which is a common use case), I'd suggest a couple of approaches:

1. At the current time, see if you can index the ratio directly as a field, either at data ingest time using Logstash or after the fact using Watcher
2. Wait until Elasticsearch 2.0 and a subsequent Kibana release that adds support for a [bucket script aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-aggregations-pipeline-bucket-script-aggregation.html), which will be able to do arithmetic on results of aggregations.

---

_[View the full topic](https://discuss.elastic.co/t/calling-groovy-script-from-kibana/2542)._
