Heartbeat: http check.response


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

I have the following heartbeat.yml

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

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

If I replace:
body: '{"abc":"123"}'
status: 200

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


(Steffen Siering) #2

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

Roadmap to Heartbeat GA 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.


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.


(Steffen Siering) #4

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.

(system) #5

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