bucketScript in kibana

I am using Kibana 4.5, I need to execute the {"script": "_value*uniqueCount"} on Average Aggregrator Metric. where uniqueCount is an agg to get the unique count of another field. I came to know this can be solved using bucketScript Aggregation/Pipeline Aggregation. But I dont know, how to execute in Kibana JSONInput

Unfortunately, this isn't something currently supported by Kibana. You can add your +1 and feedback to the enhancement requests here: