# Store a query in elasticsearch and call it from kibana

**URL:** <https://discuss.elastic.co/t/store-a-query-in-elasticsearch-and-call-it-from-kibana/35470>\
**Category:** Kibana\
**Created:** [November 24, 2015, 4:27pm UTC](https://discuss.elastic.co/t/store-a-query-in-elasticsearch-and-call-it-from-kibana/35470 "2015-11-24T16:27:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cherah30](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cherah30](https://discuss.elastic.co/u/cherah30)\
**Post date:** [November 24, 2015, 4:27pm UTC](https://discuss.elastic.co/t/store-a-query-in-elasticsearch-and-call-it-from-kibana/35470/1 "2015-11-24T16:27:40Z")

</div>

Hi Everybody,

I am looking for a way to make a type of queries like " **Select** field1, count (field2), field 3, ... **From** XXX.. **Group by** field1, ....ZZZZ

Goal : using this query to elaborate dashboard Kibana.

I thought to do things like this:

- Create this query in Elasticsearch
- Store the query in Elasticsearch
- Use the query from Kibana.

I have two questions:  
1 - Is this the right way to meet my needs?  
2 - If yes, I searched :  
2.1 A way to store a query in elasticsearch and  
2.2 call this ES query from Kibana.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 25, 2015, 1:10am UTC](https://discuss.elastic.co/t/store-a-query-in-elasticsearch-and-call-it-from-kibana/35470/2 "2015-11-25T01:10:58Z")

</div>

You can't currently do this.

---

<div class="post-metadata">

**Author:** ![cherah30](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cherah30](https://discuss.elastic.co/u/cherah30)\
**Post date:** [November 25, 2015, 10:25am UTC](https://discuss.elastic.co/t/store-a-query-in-elasticsearch-and-call-it-from-kibana/35470/3 "2015-11-25T10:25:17Z")

</div>

Thanks Mark.

Could you tell me if you have a suggestion of the best way to do ... I try to make maximum use ES and Kibana rather than an external tool (vs ETL).

---

<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:** [July 6, 2017, 2:08pm UTC](https://discuss.elastic.co/t/store-a-query-in-elasticsearch-and-call-it-from-kibana/35470/4 "2017-07-06T14:08:17Z")

</div>


