# Can heartbeat parse the html response of a URL?

**URL:** <https://discuss.elastic.co/t/can-heartbeat-parse-the-html-response-of-a-url/335374>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [June 6, 2023, 7:31pm UTC](https://discuss.elastic.co/t/can-heartbeat-parse-the-html-response-of-a-url/335374 "2023-06-06T19:31:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patr123](https://avatars.discourse-cdn.com/v4/letter/p/ac91a4/32.png) [@Patr123](https://discuss.elastic.co/u/Patr123)\
**Post date:** [June 6, 2023, 7:31pm UTC](https://discuss.elastic.co/t/can-heartbeat-parse-the-html-response-of-a-url/335374/1 "2023-06-06T19:31:33Z")

</div>

I am trying to parse the html response body of a URL in http monitor type and this is my config:

```auto
- type: http
  enabled: true
  id: narvar
  name: Narvar
  urls: ["https://status.narvar.com/"]
  schedule: '@every 10s'
    check.response:
    status: [200]
    body: 'Returns - operational(?=[^>]*class="jsx-5ffa3024fd415850)'

```

I did this using the [HTTP options | Heartbeat Reference [8.8] | Elastic](https://www.elastic.co/guide/en/beats/heartbeat/current/monitor-http-options.html)  
But this doesn't work.  
I am trying to configure a monitor for `Returns - operational` and if its not operational it should be a down monitor.

I don't see any hits in my kibana dashboard for this url. All the other regular monitors report okay.  
Not sure where I am going wrong.

---

<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:** [June 6, 2023, 9:03pm UTC](https://discuss.elastic.co/t/can-heartbeat-parse-the-html-response-of-a-url/335374/2 "2023-06-06T21:03:12Z")

</div>

If you need to handle HTML I'd highly recommend [Browser monitors](https://www.elastic.co/guide/en/observability/current/synthetics-journeys.html).

You can only look for a regexp in the returned HTML with a lightweight check, but that's it. Additionally, it won't execute javascript, which is often required.

---

<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:** [July 4, 2023, 11:03pm UTC](https://discuss.elastic.co/t/can-heartbeat-parse-the-html-response-of-a-url/335374/3 "2023-07-04T23:03:41Z")

</div>

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