Kibana Canvas

Hi All,

Trying to find some help and guidance. I'm new to Canvas (2 days) and I can already see the infinite possibilities to make some really cool stuff, but I'm really struggling.

So first off I had problems with SQL and the data from SQL but I think I've mostly cracked that now, but In addition to this, I found the Canvas Functions and trying to tackle that!

So, one of the thing's i'm trying to do is:

  • Create a visualisation to display status codes from websites e.g. 2xx, 3xx, 4xx and 5xx in a progress bar as a percentage of traffic with a dynamic MAXIMUM based on the total amount of requests. e.g. If I have 10000 requests, and 8000 (80%) were 2xx and 2000 (20%) were 5xx I'd want the gauge to read 20% etc. and display the progress value relative to the total amount of codes.

My main problems are:

  • How do I set a dynamic maximum, as i cant set the limit of say 10000000 as the gauge will show no data so I want the max to be the sum of all requests.

  • How do i set the gauge to be % rather than SUM?

My query so far..

| essql
query="SELECT response.status AS status, count (*) AS count FROM \"myindex-*\" GROUP BY status"
| math "count"
| progress shape="gauge"
font={font family="Calibri" size=24 align="center" color="#152d6d" weight="normal" underline=false italic=false} max=1000000 valueColor="#609833" valueWeight=20
| render

Any help much appreciated - There doesn't seem to be much info out there in the internet TBH so I know i'm pushing my luck!



Hey @oliverlucas!

Have you seen our canvas function reference?

There's an example for fromatnumber which shows you how to set the gauge to show a % and I think renders a really similar graph to yours without explicitly defining a max and instead doing it with math.

If you do still need to define an explicit max value, the example for escount shows how to set the max value to a function (escount isn't important here, it just is the example we want).

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