How can i count exact the number of item in array object?

How can i count exact the number of item in array object?

I have data like below.

doc1
people :
[
{email:a@virtual.com},
{email:b@virtual.com},
{email:c@another.com}
]

doc2
people :
[
{email:d@virtual.com},
{email:e@virtual.com},
{email:f@another.com}
]

I want to count the unique number of *@another.com, in the documents.

So i did in kibana like below:

visualize ->
make data table ->
In metric 'Unique Count' and select 'people' metric ->
In bucket, select 'filter' aggregation ->
wrote people.email : "*.another.com"

In result, it shows 6.
But i want value 2 (c@another.com and f@another.com)

In this case, how can i get exact the number of item in array.

Please see my answer in your other post. How can i get exact the number of item in array?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.