Kibana Visualize - Calculate difference between two metrics

Hello,
I'm in the process of making a new data table, which consists of a date bucket and 3 metrics.
First metric(A) is Count, second metric(B) is Unique Count, and third(C) I need to be the difference between A and B.

Is this even possible in Kibana, and how to achieve this?

Hi,

I don't know how to do it in a visualization - but maybe you can switch to Canvas? in Canvas you can use ElasticSearch SQL to define the data table like this:

SELECT "cluster_uuid", count(cluster_uuid) AS "COUNT", count(distinct cluster_uuid) AS "DISTINCT COUNT",count(cluster_uuid) - count(distinct cluster_uuid) AS "DUPLICATES"  FROM ".monitoring-logstash-*"
    group by "cluster_uuid"

Best regards
Wolfram

Thank you for your answer.
Unfortunately, it has to be a visualization in the data table.

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