Multiply aggregation value by a number within the query



my result looks like the one above.

The query aggregates all keys by the hour. The value is the count of equal keys by the hour.

Since the keys only reflect 50% of the observations, I want to multiply each value by the factor 2.


key = 1425020400000 with value = 216

would be

key = 1425020400000 with value = 432

How can I achieve this?

I haven't found anything. I think scripting could be an option.

But how to reuse the aggregation in the same query?

Thanks for an answer.

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit