# Heartbeat: http check.response

**URL:** <https://discuss.elastic.co/t/heartbeat-http-check-response/86219>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [May 18, 2017, 9:44am UTC](https://discuss.elastic.co/t/heartbeat-http-check-response/86219 "2017-05-18T09:44:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![N31LR](https://avatars.discourse-cdn.com/v4/letter/n/f0a364/32.png) [@N31LR](https://discuss.elastic.co/u/N31LR)\
**Post date:** [May 18, 2017, 9:44am UTC](https://discuss.elastic.co/t/heartbeat-http-check-response/86219/1 "2017-05-18T09:44:26Z")

</div>

Hi, I am having an issue using heartbeat, specifically check.response.body

I have the following heartbeat.yml

```
heartbeat.monitors:
- type: http
# List or urls to query
  urls: ["http://localhost:8090/base/status.json"]
  # request details:
  check.request:
    method: GET
  check.response:
    body: '{"abc":"123"}'
  # Configure task schedule
  schedule: '@every 10s'

```

It always returns:  
"UP": false  
"error": "type": "validate"  
"error": "message": "body mismatch"

If I replace:  
check.response:  
body: '{"abc":"123"}'  
With  
check.response:  
status: 200

UP will return as true, my issue only occurs when I use check.response.body

Thanks  
Neil

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [May 18, 2017, 11:59am UTC](https://discuss.elastic.co/t/heartbeat-http-check-response/86219/2 "2017-05-18T11:59:21Z")

</div>

The `check.response.body` check is quite limited right now. The body must match byte by byte.

[Roadmap to Heartbeat GA](https://github.com/elastic/beats/issues/3952) contains an item about enhanced validators using conditionals and other checks. e.g. regex on body or json response must match subset of configured fields and such.

---

<div class="post-metadata">

**Author:** ![N31LR](https://avatars.discourse-cdn.com/v4/letter/n/f0a364/32.png) [@N31LR](https://discuss.elastic.co/u/N31LR)\
**Post date:** [May 18, 2017, 1:09pm UTC](https://discuss.elastic.co/t/heartbeat-http-check-response/86219/3 "2017-05-18T13:09:48Z")

</div>

Hi Steffen,

Thanks for that, is there a way of seeing what heartbeat is returning.  
Just thinking in the short term until the feature is fully available, if I was able to see what heartbeat finds in the response body it may help.

Thanks  
Neil

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [May 18, 2017, 1:37pm UTC](https://discuss.elastic.co/t/heartbeat-http-check-response/86219/4 "2017-05-18T13:37:55Z")

</div>

no, heartbeat is not returning the response body, to keep the events to be generated somewhat 'small'. The logstash http\_poller or metricbeat http module might be alternative solutions I think.

---

<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:** [June 15, 2017, 1:37pm UTC](https://discuss.elastic.co/t/heartbeat-http-check-response/86219/5 "2017-06-15T13:37:58Z")

</div>

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