# Unable to implement date range filter in elastic search query

**URL:** https://discuss.elastic.co/t/unable-to-implement-date-range-filter-in-elastic-search-query/85192
**Category:** Elasticsearch
**Created:** [May 10, 2017, 6:14am UTC](https://discuss.elastic.co/t/unable-to-implement-date-range-filter-in-elastic-search-query/85192 "2017-05-10T06:14:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kunalp](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kunalp](https://discuss.elastic.co/u/kunalp)
#### Post date: [May 10, 2017, 6:14am UTC](https://discuss.elastic.co/t/unable-to-implement-date-range-filter-in-elastic-search-query/85192/1 "2017-05-10T06:14:40Z")

</div>

Hi,

When I am trying to execute below query

curl -XGET '[http://localhost:9200/logstash\*/\_search](http://localhost:9200/logstash*/_search)' -d '{ "query" : { "filter" : ["range" : { "timestamp" : {"gt" : "2017-02-01 00:00:00","lt" : "2017-05-01 00:00:00"}}]}}'

I am getting below error

{"error":{"root\_cause":[{"type":"parsing\_exception","reason":"[filter] query malformed, no start\_object after query name","line":1,"col":26}] ,"status":400}

if I am executing the date range filter from sense plugin , i am getting the desired result.

Help would b appreciated.

Regards,  
Kunal

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 10, 2017, 7:04am UTC](https://discuss.elastic.co/t/unable-to-implement-date-range-filter-in-elastic-search-query/85192/2 "2017-05-10T07:04:08Z")

</div>

Use kibana dev console then just click on the icon near the query to copy the request as a curl command and use it.

---

<div class="post-metadata">

### Author: ![kunalp](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kunalp](https://discuss.elastic.co/u/kunalp)
#### Post date: [May 10, 2017, 7:23am UTC](https://discuss.elastic.co/t/unable-to-implement-date-range-filter-in-elastic-search-query/85192/3 "2017-05-10T07:23:52Z")

</div>

thank you @dadoonet.....That also worked....

I am having one more question regarding kibana dashboard.Can we create custom dashboards with custom filters Kibana irrespective of the default dashboard kibana provides ?

If yes , would you please let me now how to do it?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 10, 2017, 7:46am UTC](https://discuss.elastic.co/t/unable-to-implement-date-range-filter-in-elastic-search-query/85192/4 "2017-05-10T07:46:32Z")

</div>

> Can we create custom dashboards with custom filters Kibana irrespective of the default dashboard kibana provides ?

That's another question which will be better to ask on #kibana forum.

> If yes , would you please let me now how to do it?

Yes you can. But the question is too vague. You have tons of videos/tutorials/docs available online.  
I'd start here: [Kibana Guide [8.11] | Elastic](https://www.elastic.co/guide/en/kibana/current/index.html)

---

<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: [June 7, 2017, 7:51am UTC](https://discuss.elastic.co/t/unable-to-implement-date-range-filter-in-elastic-search-query/85192/5 "2017-06-07T07:51:30Z")

</div>

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