Apply a script on an aggregation result in visualization

I see! Well, as I mentioned you can write a Painless script to perform changes to the values in your documents which will affect the end result of the aggregation. Here's an example of what I mean:

Here, I've defined a script which divides the "bytes" field value by 2 before it's aggregated. You can see the result in the 3rd column of the data table. Does this help? It's tough to give a more precise suggestion without knowing exactly the kind of script you need, but hopefully this provides a starting point.

CJ

1 Like