Add a custom metric to Kibana (4.1)

Kibana does not support creating fields using scripted metric aggregations:

You might be able to use JSON input in aggregations to do something fancy like that -- see one example here: Display concurrency in data on Kibana