-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
NEW
-
NEW
-
---
-
---
Assume we have an event like:
{ "incident":{ "id":"aaa", "active":false, "alerts":[ { "id":"bbb", "tags":[ { "name":"alertname", "value":"MariadbDown" }, { "name":"severity", "value":"critical" } ], "status":"Ok" }, { "id":"ccc", "tags":[ { "name":"severity", "value":"critical" }, { "name":"alertname", "value":"DiskUsage" } ], "status":"Ok" } ] } }
Rule condition:
event.incident.alerts.tags is selectattr('value', '==', 'DiskUsage')
When "alerts" and "tags" are both arrays, we want to evaluate all tags elements under all alerts elements.
Currently the condition doesn't match because alerts has to be suffixed with index accessor (e.g. alerts[1]).
We want to achieve that with
event.incident.alerts.tags is selectattr('value', '==', 'DiskUsage')
Note: we don't even support [*].
event.incident.alerts[*].tags is selectattr('value', '==', 'DiskUsage')
FYI)
https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html
JSONPath supports [*]