Canvas: compare count from two indices

I'm trying to compare two counts using Canvas.

My queries are a straight count of documents from one index:

SELECT COUNT(*) AS c1 FROM index1

And the count of a particular field value in another index:

SELECT COUNT(*) AS c2 FROM index2 WHERE field = value

I can't figure out the correct way to call the second essql query from with a math function (and I'm not really sure that's the right way to do it).

I tried following some other posts in the forum (like this one), but I'm stuck. So, how can I use two essql queries to get a ratio?

Can you also specify which version of Kibana/ES are you running?
If you saw that thread, it said you could assign variable in the canvas expression editor (check Wylie’s @wylie comment), also what do you see as an output once you use them as suggested?
I might be able to help you out as I have spent a lot of time figuring out the right query for my dashboards

Thanks for the attention.

Kibana and ES are version 7.12.1

I didn't really fully understand those suggestions, but I'll have another try and post my results.

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