Kibana(Elasticsearch) count with uniq value

大城市里の小女人 提交于 2019-12-24 05:13:05

问题


I use kibana-4

I logged like this,

{user_id: 1, taget: A}
{user_id: 1, taget: B}
{user_id: 1, taget: B}
{user_id: 1, taget: B}
{user_id: 2, taget: A}
{user_id: 2, taget: C}

And I want to draw Pie Chart(target count) that result like this.

A: 2, B: 1, C: 1

It means count only one by each user. How can I do? Can I user only Kibana's visualize options? or add some elasticsearch input?


回答1:


In metrics field select Unique Count aggregation -> user_id field

In buckets field select terms aggregation -> target field



来源:https://stackoverflow.com/questions/37116114/kibanaelasticsearch-count-with-uniq-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!