# Timelion query question for getting date

**URL:** https://discuss.elastic.co/t/timelion-query-question-for-getting-date/247711
**Category:** Kibana
**Tags:** timelion
**Created:** [September 7, 2020, 6:35am UTC](https://discuss.elastic.co/t/timelion-query-question-for-getting-date/247711 "2020-09-07T06:35:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![8wlgns](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/8wlgns/32/72733_2.png) [@8wlgns](https://discuss.elastic.co/u/8wlgns)
#### Post date: [September 7, 2020, 6:35am UTC](https://discuss.elastic.co/t/timelion-query-question-for-getting-date/247711/1 "2020-09-07T06:35:34Z")

</div>

Hello?

I have a simple question for query of timelion kibana.  
i want to draw the total documents count of specific index.

Here is query sample.  
.es(  
index=test\*,  
timefield=@timestamp,  
q='elasticsearch.index.name:test-01-2020.09.04',  
metric='avg:elasticsearch.index.total.docs.count')

But it seems to problem, because the date is static...

So I change query likes  
q='elasticsearch.index.name:test-01-\*' but it seems to get all documents count...

Is there any solution for set current time ranges?

i want to change query likes  
.es(  
index=test\*,  
timefield=@timestamp,  
q='elasticsearch.index.name:test-01-\* AND **timernage** :current time',  
metric='avg:elasticsearch.index.total.docs.count')

I try to set time ranges likes  
q='@timestamp:[now-15m/d TO now/d] AND elasticsearch.index.name:df-pipeline-dev\_airflow-worker-\*' But it seems get all documents include all yyyy.mm.dd index!

Thanks!

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [September 10, 2020, 7:28pm UTC](https://discuss.elastic.co/t/timelion-query-question-for-getting-date/247711/2 "2020-09-10T19:28:23Z")

</div>

The time range is controlled by the time picker in the top right, why are you trying to use an additional query parameter for time range?

---

<div class="post-metadata">

### Author: ![8wlgns](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/8wlgns/32/72733_2.png) [@8wlgns](https://discuss.elastic.co/u/8wlgns)
#### Post date: [September 14, 2020, 4:23pm UTC](https://discuss.elastic.co/t/timelion-query-question-for-getting-date/247711/3 "2020-09-14T16:23:53Z")

</div>

Yes you're right. ( I have some confused some metricbeat field side.)  
For timerange, I use the time picker in the top right.

Thanks you very much your reply!

---

<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, 2020, 4:23pm UTC](https://discuss.elastic.co/t/timelion-query-question-for-getting-date/247711/4 "2020-10-12T16:23:55Z")

</div>

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