问题
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