How to dynamically pass range query variables

hi
We need to pass dynamic values into the filter range query within watcher, using a "painless" script. something like below

"filter": [ 
 {
   "range": {
      "@timestamp": {
         "lte": "now-{{dynamicValueLte}}",
         "gte": "now-{{dynamicValueGte}}"
        }
     }
   }
 }
]

the aim is to execute logic for a time range dynamically based on a configuration/json
have anyone encountered or fixed similar issue?

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