I create a watcher running each 10m, and aggregate result with date_histogram interval 15m.
Now I wanna set offset of aggregation based on the time it executes, how should I config with the watcher (version 5.4).
Here is my watcher configuration and offset is the description which expected.
{
"trigger":{ "schedule":{ "interval":"10m" } },
"input":{
"search":{
"request":{
"search_type":"query_then_fetch",
"indices":["my-index-of-log-*"],
"types":[],
"body":{
"size":0,
"query":{
"bool":{
"must":[
{ "range":{ "log_date":{ "gte":"now-6h", "lte":"now" } } },
{ "term":{ "level":"error" } }
]
}
},
"aggs":{
"log_date":{
"date_histogram":{
"field":"log_date",
"interval":"15m",
"offset":"something values `(now.date.minuteOfHour % 15) m`"
}
}
}
}
}
}
},
"condition":{ },
"actions":{ }
}