I would like to know if there is a way to define a time range as follows.
With a watcher I am looking for records with a certain message within a field. The problem is that I want it to find the records 72 hours after they have been entered.
this is my code:
GET my_index/_search
{
"query": {
"bool": {
"should": [
{
"match_phrase": {
"status": {
"query": "process"
}
}
},
{
"match_phrase": {
"estatus": {
"query": "error"
}
}
},
{
"range": {
"date": {
"gte": "now-72h",
"time_zone": "-06:00"
}
}
}
]
}
}
}
My problem is that the query always returns records that match the "status" field but without respecting the range (i.e. it can bring even older/newer records). I understand that by placing now I specify the current day. That said, how can I configure it to only fetch records from -72 hours? thank you community.