# Heartbeat check against websocket URL

**URL:** <https://discuss.elastic.co/t/heartbeat-check-against-websocket-url/160033>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [December 9, 2018, 7:41am UTC](https://discuss.elastic.co/t/heartbeat-check-against-websocket-url/160033 "2018-12-09T07:41:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franz\_Allan\_Valencia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franz_allan_valencia/32/3326_2.png) [@Franz\_Allan\_Valencia](https://discuss.elastic.co/u/Franz_Allan_Valencia)\
**Post date:** [December 9, 2018, 7:41am UTC](https://discuss.elastic.co/t/heartbeat-check-against-websocket-url/160033/1 "2018-12-09T07:41:51Z")

</div>

Hi,

Is there a way I can check my webservice's websocket's "heartbeat"? I just want heartbeat to be able to connect to a websocket URL and verify a JSON response.

I'm currently trying this but its failing

```auto
- type: http
  name: 'Websocket Check'
  schedule: '@every 5s'
  urls: ["http://myserver:80/myservice/wsendpoint"]
  check.request:
    headers:
      'Pragma': 'no-cache'
      'Origin': 'http://myserver'
      'Accept-Encoding': 'gzip, deflate'
      'Accept-Language': 'en-US,en;q=0.9'
      'Sec-WebSocket-Key': 'YzcC7Fy1g/mlss3qO2Kz1Q=='
      'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36'
      'Upgrade': 'websocket'
      'Sec-WebSocket-Extension': 'permessage-deflate; client_max_window_bits'
      'Cache-Control': 'no-cache' 
      'Connection': 'Upgrade'
      Sec-WebSocket-Version': '13'

```

_Note: I got this parameters from my chrome - by right clicking on the websocket URL and copying as CURL_

_Note2: If I use the CURL command in my bash (and as long as I replace the 'ws://' part with 'http://', it works). But the same settings though dont work with heartbeat_

Any thoughts?

Thanks,  
Franz

---

<div class="post-metadata">

**Author:** ![Franz\_Allan\_Valencia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franz_allan_valencia/32/3326_2.png) [@Franz\_Allan\_Valencia](https://discuss.elastic.co/u/Franz_Allan_Valencia)\
**Post date:** [December 9, 2018, 7:44am UTC](https://discuss.elastic.co/t/heartbeat-check-against-websocket-url/160033/2 "2018-12-09T07:44:20Z")

</div>

Nevermind, after posting my question here, i saw the problem 😃

My header `Sec-WebSocket-Version` wasnt properly quoted 😃

Thanks anyway! 😃

---

<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:** [January 4, 2019, 9:57pm UTC](https://discuss.elastic.co/t/heartbeat-check-against-websocket-url/160033/3 "2019-01-04T21:57:01Z")

</div>

Sorry for the late reply, but glad you found an answer!

We should, however, make this easier to configure, ideally we'd just have a websocket mode. Thanks for this awesome post 🙂

---

<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:** [February 1, 2019, 9:57pm UTC](https://discuss.elastic.co/t/heartbeat-check-against-websocket-url/160033/4 "2019-02-01T21:57:02Z")

</div>

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