Getting timebased results in Elasticsearch using Python

Hi All, I am newbie here and have a problem here getting correct results out of Elasticsearch. We have a pipeline where logs flow from Logstash into ES and then Kibana.
The data is flows perfectly and we can see the visualizations on Kibana dashboard.
But when I am trying to get a copy of the data that flows from ES to Kibana using a python script, I am getting historical data. I getting some logs from June.

Below is my query:

from elasticsearch import Elasticsearch
es=Elasticsearch([{'host':'localhost','port':9200}])
result = es.search(index='*',body={
"query": {
"range" : {
"date" : {
"gte" : "now-15m/d",
"lt" : "now/d"
}
}
}
})

the below query also gives wrong results:
result1 = es.search(index='*',body={'query':{'match_all':{}}})

I did refer to this thread:

Please suggest.

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