Unable to implement date range filter in elastic search query


(Kunal Parsewar) #1

Hi,

When I am trying to execute below query

curl -XGET '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


(David Pilato) #2

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


(Kunal Parsewar) #3

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?


(David Pilato) #4

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: https://www.elastic.co/guide/en/kibana/current/index.html


(system) #5

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