Hi there:
I'm stuck at the Watch Action body text section, I have a payload below. Is that possible to only retrieve which service and host's doc_count < 5 ? in order to determine what are the services are unavailable with their hosts.
I might need a loop but don't think "body" allows painless script? Pls advise, thank you so much.
Expected email body output eg:
The following services with their respective host are unavailable,
serviceA-health-check-status, host2
serviceB-health-check-status, host2
serviceC-health-check-status, host2
"payload": {
"ServiceUnavailable": [
{
"serviceId": "serviceA-health-check-status",
"serviceId-details": [
{
"doc_count": 5,
"key": "host1"
},
{
"doc_count": 3,
"key": "host2"
}
]
},
{
"serviceId": "serviceB-health-check-status",
"serviceId-details": [
{
"doc_count": 5,
"key": "host1"
},
{
"doc_count": 3,
"key": "host2"
}
]
},
{
"serviceId": "serviceC-health-check-status",
"serviceId-details": [
{
"doc_count": 5,
"key": "host1"
},
{
"doc_count": 3,
"key": "host2"
}
]
}
]
}
}