# Canvas - Variable in essql

**URL:** <https://discuss.elastic.co/t/canvas-variable-in-essql/294857>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [January 19, 2022, 5:03pm UTC](https://discuss.elastic.co/t/canvas-variable-in-essql/294857 "2022-01-19T17:03:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![probson](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@probson](https://discuss.elastic.co/u/probson)\
**Post date:** [January 19, 2022, 5:03pm UTC](https://discuss.elastic.co/t/canvas-variable-in-essql/294857/1 "2022-01-19T17:03:57Z")

</div>

Im trying to use the canvas variables, i have managed to get it working via text/markdown, i am trying to use it within an essql statement, heres my example

```auto
WHERE \"@timestamp\" > TODAY() - INTERVAL 30 DAY AND organization.name=\"" {var 'Org'} "\"

and also tried

WHERE \"@timestamp\" > TODAY() - INTERVAL 30 DAY AND organization.name=\"" {var "Org"} "\"

```

Any suggestions?  
Ive also created a dropdown filter, i get the correct info in the drop down, again same field, organization.name. How do i get that filter to apply to Kibana elements? Or if its possible to use the variable on the kibana elements

---

<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:** [February 16, 2022, 5:04pm UTC](https://discuss.elastic.co/t/canvas-variable-in-essql/294857/2 "2022-02-16T17:04:13Z")

</div>

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