Hi @mrvincnezo,
The syntax for specifying scripts in the aggregation DSL has become stricter in 5.0. Instead of:
{"script" : "doc['iteration_duration'].value", "lang": "groovy"}
Try this:
{ "script": { "inline": "doc['bytes'].value", "lang": "groovy" } }