Hi there!
Is there any way to run Transform periodically (e.g., at each 5 seconds) regardless of having an update in the sync date field of source index?
I'm trying to use Transform to aggregate values in a sliding window over the time (e.g., now-24h), but new values in source index only arrive when a new event occurs. So, my sliding window should not consider the first old values as the time goes by.
I already tried to use only the "frequency" param of Transform (without the "sync" param), but it was created in batch mode, not continuous. If I use "sync" param, transform remains waiting for a doc datetime update to execute.
Transform script:
PUT _transform/my_transform
{
"source": {
"index": [
"source_index"
],
"query": {
"bool": {
"must": [
{
"range": {
"datetime": {
"gte": "now-24h"
}
}
}
]
}
}
},
"dest": {
"index": "dest_index"
},
"frequency": "5s",
"pivot": {
"group_by": {
"code": {
"terms": {
"field": "code.keyword"
}
}
},
"aggregations": {
"agg24h": {
"sum": {
"field": "value"
}
}
}
}
}
Any suggestion? Is there any other best way to do that?
Regards