I believe you could run a terms aggregation on the city field, and under
this terms aggregation put two sum aggregations, one for clicks and one for
displays. And finally you could derive the click rate from the sum of
clicks and displays on client side? If you are starting playing with
aggregations, I would recommend reading this blog post by Zachary Tong:
On Wed, Jan 14, 2015 at 10:43 PM, Yan Georget yan@ogury.co wrote:
Hello,
Let's imagine I am logging displays and clicks, say by cities.
I can aggregate those by countries and I can also compute grand totals.
Now I would like to compute click rates (clicks/displays) by cities,
countries and I would also like to get a global click rate.
How can I do this?
It seems that I could use a scripted metric (I have not tried yet) but I
would also like to expose these rates in Kibana.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.