# Elasticsearch|Grafana|Variable Templates

**URL:** <https://discuss.elastic.co/t/elasticsearch-grafana-variable-templates/199323>\
**Category:** Elasticsearch\
**Created:** [September 12, 2019, 8:05pm UTC](https://discuss.elastic.co/t/elasticsearch-grafana-variable-templates/199323 "2019-09-12T20:05:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chinmay.parkar](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@chinmay.parkar](https://discuss.elastic.co/u/chinmay.parkar)\
**Post date:** [September 12, 2019, 8:05pm UTC](https://discuss.elastic.co/t/elasticsearch-grafana-variable-templates/199323/1 "2019-09-12T20:05:32Z")

</div>

How can I make a Grafana template with a variable reference another variable using Elasticsearch as a datasource?

I have a Grafana dashboard with template variables for `fields` and `terms` . When I select a field how can I make it filter the second template variable list based on the first?

The first part is working when i use {"find": "fields", "type": "string"} \>\> I am able to see all the fields in my database now I could not figure how to create the second template variable

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 14, 2019, 10:19am UTC](https://discuss.elastic.co/t/elasticsearch-grafana-variable-templates/199323/2 "2019-09-14T10:19:43Z")

</div>

This seems to be a question better directed at theGrafzna community.

---

<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:** [October 12, 2019, 10:19am UTC](https://discuss.elastic.co/t/elasticsearch-grafana-variable-templates/199323/3 "2019-10-12T10:19:46Z")

</div>

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