Monitor the JSON payload from heartbeat.yml

I'm new to the uptime / heartbeat service Version 6.8.3 that I'm trying to config brunch of urls which sends the healthbeat result to Uptime Kibana. The basic JSON payload body should return the following output,

EG:

curl -i https://identityserver-p-xx-ue1.abc.com/api/v1/health/details

    {"CanConnectToIdentityDB":"Ok At: 09/17/2019 00:05:13 +00:00","CanConnectToUserProfileService":"Ok At: 09/17/2019 00:05:13 +00:00"}

curl -i "https://openidapi-d-xx-ue1.bluebeam-dev.com/api/v1/health/details"

    {"canConnectToIdentityDB":"Ok At: 09/17/2019 00:05:22 +00:00","canConnectToUserProfileService":"Ok At: 09/17/2019 00:05:22 +00:00"}

What I'm trying to capture in the heartbeat.yaml is to detect the JSON response has a validate object such that Key can be any service strings and Value is "OK" without the timestamp string.

{"CanConnectToIdentityDB":"Ok*", "CanConnectToUserProfileService":"OK*"}
or
{"CanConnectToIdentityDB":"Ok*"}

From what I read here, Set up Heartbeat monitors | Heartbeat Reference [6.8] | Elastic, it seems possible with JSON condition and mix multiline regex clauses. There is not much example in this area or any answer on the web, if you can provide an example on how to go about it then it would be wonderful.

This isn't possible today unfortunately. However we do have an open issue for improving Heartbeat to support Javascript for body validation, which would let you correctly handle this situation. What do you think about that solution?

This topic was automatically closed 24 days after the last reply. New replies are no longer allowed.