How to write trigger condition

#1

I am writing trigger condition for user created and deleted within 10 mn. Below is condition , but it is giving
compile error

{“script”:{ “lang”: “painless”,
“source”: “def removes=ctx.payload.aggregations.event_id.buckets.remove.users.buckets.stream().map(p -> p.key).collect(Collectors.toList()); return ctx.payload.aggregations.event_id.buckets.add.users.buckets.stream().map(p -> p.key).filter(p -> removes.contains§).toArray().length > 0;”
}}

#2

Hi Yogesh,

Please refer to:
https://opendistro.github.io/for-elasticsearch-docs/docs/alerting/monitors/#extraction-query
The monitor query response should be accessed using ctx.results[0] instead of ctx.payload

Thanks,
Drew