hello team,
i want to increment date field """ {{ctx.payload.second.time}} + 30m """ in watcher but i don't know how to do it, any idea ?
my code :
"input": {
"chain": {
"inputs": [
{
"first": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"index-1-"
],
"rest_total_hits_as_int": true,
"body": {
"size": 2,
"query": {
"bool": {
"should": [
{
"term": {
"a.keyword": ""
}
},
{
"term": {
"n.keyword": ""
}
}
],
"minimum_should_match": 2
}
},
"sort": [
{
"date": {
"order": "desc"
}
}
]
}
}
}
}
},
{
"second": {
"transform": {
"script": {
"source": "return [ 'time' : ctx.payload.first.hits.hits.0._source.date ]",
"lang": "painless"
}
}
}
},
{
"third": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"index-2-"
],
"rest_total_hits_as_int": true,
"body": {
"size": 1,
"query": {
"bool": {
"must": [
{
"term": {
"c.keyword": ""
}
},
{
"term": {
"en.keyword": "*"
}
},
{
"term": {
"order_file_type.keyword": ""
}
},
{
"range": {
"metadata.ingested": {
"gte": "{{ctx.payload.second.time}}"
"lte":"{{ctx.payload.second.time}} + 30"
}
}
}
]
}
},
"aggs": {
"1": {
"cardinality": {
"field": "filename.keyword"
}
}
}
}
}
}
}
}
]
}
},
thanks for help.