# Monitor the JSON payload from heartbeat.yml

**URL:** <https://discuss.elastic.co/t/monitor-the-json-payload-from-heartbeat-yml/199740>\
**Category:** Synthetics\
**Created:** [September 17, 2019, 12:23am UTC](https://discuss.elastic.co/t/monitor-the-json-payload-from-heartbeat-yml/199740 "2019-09-17T00:23:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfang329](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@mfang329](https://discuss.elastic.co/u/mfang329)\
**Post date:** [September 17, 2019, 12:23am UTC](https://discuss.elastic.co/t/monitor-the-json-payload-from-heartbeat-yml/199740/1 "2019-09-17T00:23:20Z")

</div>

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](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](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](https://www.elastic.co/guide/en/beats/heartbeat/6.8/configuration-heartbeat-options.html), 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.

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [October 9, 2019, 12:52pm UTC](https://discuss.elastic.co/t/monitor-the-json-payload-from-heartbeat-yml/199740/2 "2019-10-09T12:52:14Z")

</div>

This isn't possible today unfortunately. However we do have an [open issue](https://github.com/elastic/beats/issues/13982) for improving Heartbeat to support Javascript for body validation, which would let you correctly handle this situation. What do you think about that solution?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 2, 2019, 12:52pm UTC](https://discuss.elastic.co/t/monitor-the-json-payload-from-heartbeat-yml/199740/3 "2019-11-02T12:52:15Z")

</div>

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