How to search a text in a field with in a particular time range


#1

I'm trying to run a job which runs every 30 minutes to query the elastic search index and matches the message field with particular text(eg: job ran failed) within the 30 min time range only. Is there any pre-built lucene query which is available to search a text and match only within the time range provided or is there any another API approach I could follow. I have tried different queries which seem to be providing responses from the whole index not particular to a time period.


(David Pilato) #2

A range query?
Using now as part of the values.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html#ranges-on-dates


(system) #3

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