# KIbana SQL query parametrization

**URL:** <https://discuss.elastic.co/t/kibana-sql-query-parametrization/289787>\
**Category:** Kibana\
**Created:** [November 22, 2021, 8:59am UTC](https://discuss.elastic.co/t/kibana-sql-query-parametrization/289787 "2021-11-22T08:59:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marekpowwm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marekpowwm/32/97372_2.png) [@marekpowwm](https://discuss.elastic.co/u/marekpowwm)\
**Post date:** [November 22, 2021, 8:59am UTC](https://discuss.elastic.co/t/kibana-sql-query-parametrization/289787/1 "2021-11-22T08:59:39Z")

</div>

Is it possible to add a parameter to select index using ES SQL? I created a variable named indexName and I tried to add it to the query this way:

SELECT \* FROM "{indexName}"

But I get the error:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/e/ae6c8806ea56d181fe09abd4eeb17614b02499d2.png)

So my question is: is there any way to pass parameters to the Kibana query? I especially need to pass the index name to that query.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [December 2, 2021, 8:33pm UTC](https://discuss.elastic.co/t/kibana-sql-query-parametrization/289787/2 "2021-12-02T20:33:12Z")

</div>

Hi, it is possible to do this when querying Elasticsearch directly: [Passing parameters to a query | Elasticsearch Guide [master] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/master/sql-rest-params.html)

But it might not be supported by the Kibana app or version of Kibana you are using.

What app are you using to write this SQL?

---

<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:** [December 30, 2021, 8:33pm UTC](https://discuss.elastic.co/t/kibana-sql-query-parametrization/289787/3 "2021-12-30T20:33:25Z")

</div>

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