I need to get the watcher's triggered time and subtract a random time (e.g. 5mins from it)
I am trying something on the following lines but with no success.
Input:
"transform": {
"script": {
"source": "return [ 'time' : '{{ctx.trigger.triggered_time}}||-5m' ]",
"lang": "painless"
}
This literally prints out the string.
Output:
"transform": {
"type": "script",
"status": "success",
"payload": {
"time": "{{ctx.trigger.triggered_time}}||-5m"
}
},
Isn't transform the right place to do it? Or am I just doing it wrong?
if {{ctx.trigger.triggered_time}}
is returned as is (without any math on it), it returns the correct time.
Please assist.