Hi, all
The follow is run correct.
"transform": {
"script": {
"source": "return ['error_count' : ctx.payload.aggregations.whichHost.buckets.length, 'hosts' : ctx.payload.aggregations.whichHost.buckets.stream().map(item -> item.key).collect(Collectors.toList()).join(', '), 'process' : 'ntpd' ]",
"lang": "painless"
}
}
But I got a "internal server error", just moving the source in a file.
The script file:
{
"script": {
"lang": "mustache",
"source": "return ['error_count' : ctx.payload.aggregations.whichHost.buckets.length, 'hosts' : ctx.payload.aggregations.whichHost.buckets.stream().map(item -> item.key).collect(Collectors.toList()).join(', '), 'process' : 'ntpd' ]"
}
}
The snippet in the watcher
"transform": {
"script": {
"id": "script_process_trans",
"lang": "painless"
}
}
I'm sure the filename is right.
How can I ......
PS. could not use the error information like that? The user saw it will be crazy.