Hello,
I’m new to this. I am using a “Per bucket monitor” and have the following extraction query response:
{
“_shards”: {
“total”: 366,
“failed”: 0,
“successful”: 366,
“skipped”: 342
},
“hits”: {
“hits”: ,
“total”: {
“value”: 10000,
“relation”: “gte”
},
“max_score”: null
},
“took”: 64,
“timed_out”: false,
“aggregations”: {
“users”: {
“doc_count_error_upper_bound”: 0,
“sum_other_doc_count”: 0,
“buckets”: [
{
“doc_count”: 76,
“country_bucket_count”: {
“value”: 2
},
“countries”: {
“doc_count_error_upper_bound”: 0,
“sum_other_doc_count”: 0,
“buckets”: [
{
“doc_count”: 68,
“key”: “United Arab Emirates”
},
{
“doc_count”: 8,
“key”: “Latvia”
}
]
},
“key”: “``user1@domain.com``”
},
{
“doc_count”: 57,
“country_bucket_count”: {
“value”: 2
},
“countries”: {
“doc_count_error_upper_bound”: 0,
“sum_other_doc_count”: 0,
“buckets”: [
{
“doc_count”: 44,
“key”: “Luxembourg”
},
{
“doc_count”: 13,
“key”: “Belgium”
}
]
},
“key”: “``user2@domain.com``”
},
{
“doc_count”: 56,
“country_bucket_count”: {
“value”: 2
},
“countries”: {
“doc_count_error_upper_bound”: 0,
“sum_other_doc_count”: 0,
“buckets”: [
{
“doc_count”: 49,
“key”: “Sweden”
},
{
“doc_count”: 7,
“key”: “Spain”
}
]
},
“key”: “``user3@domain.com``”
}
]
}
}
}
I need to create an alert for every user. How can I achieve this? Is it even possible? I can’t get it to work no matter what.
Here is my trigger condition:
{
“buckets_path”: {
“count”: “_count”
},
“parent_bucket_path”: “users”,
“script”: {
“source”: “params.count > 0”,
“lang”: “painless”
},
“gap_policy”: “skip”
}
It just returns:
[
{},
{},
{}
]
After that, I can only configure the alert message to display either a specific user (by index) or all users in a single message.
Is it possible for a trigger to run per bucket and generate as many alerts as there are users extracted by the query?