Just starting out with Canvas so bear with me
I am trying to get a box colored based on status, and here's what I have so far
filters
| essql
query="SELECT
CASE WHEN LAST(\"kubernetes.pod.status.phase\", \"@timestamp\") = 'failed' THEN 0
WHEN LAST(\"kubernetes.pod.status.phase\", \"@timestamp\") = 'pending' THEN 1
ELSE 100 END as status,
CASE WHEN LAST(\"kubernetes.pod.status.phase\", \"@timestamp\") = 'failed' THEN '#ff0000'
WHEN LAST(\"kubernetes.pod.status.phase\", \"@timestamp\") = 'pending' THEN '#ffff00'
ELSE '#00ff00' END as color,
\"kubernetes.pod.name\" as podname
FROM \"metricbeat-*\"
WHERE
\"kubernetes.app\" = 'proxy'
AND
\"kubernetes.pod.status.phase\" IS NOT NULL
GROUP BY
podname"
| sort | shape "square" fill="{{rows.[0].color}}" border="rgba(255,255,255,0)" borderWidth=0 maintainAspect=false | render
I have verified that the query outputs the correct data, an dthe above expression works perfectly when I output the color in a "markdown" text. But the shape box remains black.
I feel like I am missing something fundamental here, but I'm not sure where to even start digging, and I can't find any examples of something similar in the docs.