How to set time range in Search API?

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): v 2.4.1

Describe the issue: I would like to know how can I filter timestamp in search API.

I am currently using the " /target-index/_search" path from OpenSearch API, and my query is similar to the following

{
  "query": {
    "match": {
      "text_entry": "error"
    }
  }
}

I tried to add some query filters, such as @timestamp>"2023-12-11T00:00:00", but It didn’t work.

Hi @alonsocaio ,

have you tried something like below:

{
  "query": {
    "range": {
      "timestamp": {
        "gte": "2023-12-11T00:00:00",
        "lte": "now/d"
      }
    }
  }
}

Best,
Mantas