Kibana metric aggregation - sum distinct

I want to use Elasticsearch and my idea is to access my SQL database and with a query join all the data that I have in my database. I solve this problem and now I am trying to do some visualizations.

My data:
x1, x2, x3
term1, 10, 56
term1, 20, 56
term1, 12, 56
term2, 10, 67
term2, 12, 67

I want to have the sum of x3 but only have 1 time the x3 value for x1, like:
x1, x3
term1, 56
term2, 67
To do this, I can use a sum bucket aggregation of x1 and calculate average of x3, for each x1.

Now, I want to sum x3 and have value 123 (56+67).

My problem is here! How can I do this?

Here is the metric aggregation I made:

Thank you,

Hey @Francisca_Lima, you can do this using a configuration similar to the following:

The problem is that the size is limited to 10000.

The problem is that the size is limited to 10000.

Would you mind clarifying what limit you're referring to?

I want to aggregate x1 to have the value of the metric. However, the maximum size is 10 000.

That limit is for the number of "buckets" do you have over 10,000 distinct values for x1?

x1 is the identification code, so I have more than 10 000 distinct values.

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