如何在Kibana + Elasticsearch中进行脚本集合? [英] How can I do scripted aggregation in Kibana + Elasticsearch?

查看:113
本文介绍了如何在Kibana + Elasticsearch中进行脚本集合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个通过Logstash在Elasticsearch中存储并显示在Kibana 4中的广告显示和广告点击事件日志。我想计算一个简单的指标,例如点击率(点击率)的事件,其中是:



CTR =#clicks /#显示。



首先,有谁知道是否可以在Elasticsearch + Kibana做?我在基巴那看不到有可能做到这一点。
我正在考虑在原始的弹性搜索中通过脚本集合。但是我不知道如何在基巴那定义这个。



任何有关如何做到这一点的想法将是非常受欢迎的!

解决方案

Kibana 4包括支持弹性搜索脚本。您可以转到设置>指数(选择您的模式)>脚本字段,并添加一个计算您的点击率的新脚本字段。请查看脚本字段弹性博客更多信息。


Let's say I have a log of events of ad displays and ad clicks stored via Logstash in Elasticsearch and displayed in Kibana 4. I would like to calculate a simple metric like CTR (Click-Through-Rate) of the events , which is :

CTR = #clicks/#displays.

First of all, does anyone know if it's possible to do in Elasticsearch + Kibana? I don't see a possibility to do it in Kibana. I was thinking about doing it in raw Elasticsearch by scripted aggregation. But I don't know how to define such in Kibana.

Any ideas on how to do it would be very welcome! Comments explaining that it's impossible to do it would be also valuable.

解决方案

Kibana 4 includes support for Elasticsearch scripting. You can go to Settings > Indices (pick your pattern) > Scripted Fields and add a new scripted field that computes your CTR. Take a look at "Scripted Fields" at elastic blog for more info.

这篇关于如何在Kibana + Elasticsearch中进行脚本集合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆