Jaehyun Shin
Jaehyun Shin

Reputation: 1602

Kibana(Elasticsearch) count with uniq value

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?

Upvotes: 2

Views: 474

Answers (1)

alpert
alpert

Reputation: 4655

In metrics field select Unique Count aggregation -> user_id field

In buckets field select terms aggregation -> target field

Upvotes: 1

Related Questions