# Element involves results from two KQLs?

**URL:** <https://discuss.elastic.co/t/element-involves-results-from-two-kqls/270915>\
**Category:** Kibana\
**Created:** [April 22, 2021, 2:34am UTC](https://discuss.elastic.co/t/element-involves-results-from-two-kqls/270915 "2021-04-22T02:34:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tangkalo](https://avatars.discourse-cdn.com/v4/letter/t/cdc98d/32.png) [@tangkalo](https://discuss.elastic.co/u/tangkalo)\
**Post date:** [April 22, 2021, 2:34am UTC](https://discuss.elastic.co/t/element-involves-results-from-two-kqls/270915/1 "2021-04-22T02:34:41Z")

</div>

Hi, in Kibana Canvas, I want to have an image element that changes color according to results from two separate KQLs. Is it possible? If not, any suggestions on how I may be able to work around this limitation?

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Felix\_Roessel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix_roessel/32/41623_2.png) [@Felix\_Roessel](https://discuss.elastic.co/u/Felix_Roessel)\
**Post date:** [April 22, 2021, 4:21am UTC](https://discuss.elastic.co/t/element-involves-results-from-two-kqls/270915/2 "2021-04-22T04:21:25Z")

</div>

This sounds like a use case for canvas. There you can have multiple queries and using conditionals to decide about how to reflect the data in your visualizations.

Is using canvas an option for you?

Otherwhise also vega could work for you in a normal dashboard.

---

<div class="post-metadata">

**Author:** ![tangkalo](https://avatars.discourse-cdn.com/v4/letter/t/cdc98d/32.png) [@tangkalo](https://discuss.elastic.co/u/tangkalo)\
**Post date:** [April 22, 2021, 12:09pm UTC](https://discuss.elastic.co/t/element-involves-results-from-two-kqls/270915/3 "2021-04-22T12:09:34Z")

</div>

Actually I am using canvas. Here's what I am currently doing to control color of the image element in canvas based on 'data\_source1', but I need to modify it so that it will also depend on result from another query, e.g. name = 'data\_source2'.

Is there a way I can do that? Thanks.

```
filters group="img_group1"
| essql 
  query="SELECT overallStatus FROM \"index*\"
WHERE name = 'data_source1'
ORDER BY \"@timestamp\" DESC
LIMIT 1"
| getCell "overallStatus"
| image 
  dataurl={switch case={case if={eq "error"} then={asset "asset-a5081913-6583-4748-81a2-58f13bf64747"}} case={case if={eq "warn"} then={asset "asset-c268a80c-fc5f-44b9-81b2-96b473fd2fd4"}} case={case if={eq "OK"} then={asset "asset-059c3593-b70f-4fa0-90c3-292b09086fd6"}} default={asset "asset-a5081913-6583-4748-81a2-58f13bf64747"}} mode="contain"
| render
```

---

<div class="post-metadata">

**Author:** ![Felix\_Roessel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix_roessel/32/41623_2.png) [@Felix\_Roessel](https://discuss.elastic.co/u/Felix_Roessel)\
**Post date:** [April 22, 2021, 3:34pm UTC](https://discuss.elastic.co/t/element-involves-results-from-two-kqls/270915/4 "2021-04-22T15:34:10Z")

</div>

Okay thats looks already pretty good.  
For a second query I would recommend using variables.

This canvas board is a good example for that kind of job:

> **[APM Services overview canvas dashboard at elastic content share](https://elastic-content-share.eu/downloads/apm-services-overview-canvas/)**
>
> The APM services canvas is an adaptive canvas board that fits to your APM data. If you running Elastic APM -- try it for free!

---

<div class="post-metadata">

**Author:** ![tangkalo](https://avatars.discourse-cdn.com/v4/letter/t/cdc98d/32.png) [@tangkalo](https://discuss.elastic.co/u/tangkalo)\
**Post date:** [April 25, 2021, 7:18pm UTC](https://discuss.elastic.co/t/element-involves-results-from-two-kqls/270915/5 "2021-04-25T19:18:30Z")

</div>

Thanks, Felix. I'll take a look at variables.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 23, 2021, 7:19pm UTC](https://discuss.elastic.co/t/element-involves-results-from-two-kqls/270915/6 "2021-05-23T19:19:06Z")

</div>

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