Code:
sum(last_foreach(/host1/*?[tag="IPGroup:{#IPGROUP.NAME}" and tag="CAPS:out"]))
+
sum(last_foreach(/host2/*?[tag="IPGroup:{#IPGROUP.NAME}" and tag="CAPS:out"]))
[{
"description": "ARM_4.10_1.2",
"id": "7",
"name": "ARM_4.10_1.2",
"url": "/api/v1/kpi/current/sbc/callStats/ipGroup/7"