I’m trying to set up a Per Query Monitor and I want to create alerts with this monitor. While I was trying to set up my query, I couldn’t use the group-by field for my query.
In my example data as you see there are the “device” field and “total_count” fields. I have 2 devices, a computer, and a phone I want to send an alert when these devices have over 10 “total_count”. I can alert when the total_count field is above 10 but I also want to group-by the alert by the “device” field. But when I tried that I couldn’t be able to see my device field in the group-by section.
Mappings for my data:
“device” field is “text”
“total_count” field is “long”
My 2nd question is when I created an alert it also sends alerts while the alert’s status is alerting. Since my alert works every minute this means back-to-back same alerts every minute. This is an issue for me because I don’t want to get the same alert every minute. Can I prevent this?
What version of OpenSearch are you using? Have you updated to the latest version of OpenSearch as there may be a bug in the version you are using. @mertkaant
As far as I know, the terms aggregation (which is what’s being applied on the group by fields here), cannot be done on a text field directly. You’ll want to provide a keyword subfield for the text field and aggregate on that.
Here is what an example mapping would look like for device:
Hi @qreshi i have this case where group by is showing up when i am trying to create visualization on field which is keyword but nothing shows up in group by when trying to create monitor.