# Try to use heartbeat to ping thrift interface

**URL:** https://discuss.elastic.co/t/try-to-use-heartbeat-to-ping-thrift-interface/108106
**Category:** Beats
**Tags:** heartbeat
**Created:** [November 17, 2017, 10:20am UTC](https://discuss.elastic.co/t/try-to-use-heartbeat-to-ping-thrift-interface/108106 "2017-11-17T10:20:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jiangzhileaf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jiangzhileaf/32/24410_2.png) [@jiangzhileaf](https://discuss.elastic.co/u/jiangzhileaf)
#### Post date: [November 17, 2017, 10:20am UTC](https://discuss.elastic.co/t/try-to-use-heartbeat-to-ping-thrift-interface/108106/1 "2017-11-17T10:20:14Z")

</div>

try to use heartbeat to ping thrift interface(call ping method , receive string "pong")  
i ping through tcp and need to send a binary data as below:

check.send: "\x00\x00\x00\x10\x80\x01\x00\x01\x00\x00\x00\x04\x70\x69\x6e\x67\x00\x00\x00\x01\x00"  
check.receive: "\x00\x00\x00\x1c\x80\x01\x00\x02\x00\x00\x00\x04\x70\x69\x6e\x67\x00\x00\x00\x01\x0b\x00\x00\x00\x00\x00\x04\x50\x4f\x4e\x47\x00"

but "\x80" seems to be overflow ,

send data would become：  
\x00\x00\x00\x10 \x2c \x80\x01\x00\x01\x00\x00\x00\x04\x70\x69\x6e\x67\x00\x00\x00\x01\x00

additional "\x2c"

---

<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: [November 17, 2017, 1:54pm UTC](https://discuss.elastic.co/t/try-to-use-heartbeat-to-ping-thrift-interface/108106/2 "2017-11-17T13:54:19Z")

</div>

1. Can you try to put the string with single quotes? like `check.send: '\x00\x00\x00\x10\x80\x01\x00\x01\x00\x00\x00\x04\x70\x69\x6e\x67\x00\x00\x00\x01\x00'`. If double quotes are used, the YAML parser interprets strings itself. Using `'` the string is passed to heartbeat as is.

2. Feel free to open an [enhancement request](https://github.com/elastic/beats/issues) for an heartbeat thrift monitor. Instead of messing with the `tcp` monitor, it should be as easy as using the `thrift` monitor type.

---

<div class="post-metadata">

### Author: ![jiangzhileaf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jiangzhileaf/32/24410_2.png) [@jiangzhileaf](https://discuss.elastic.co/u/jiangzhileaf)
#### Post date: [November 18, 2017, 4:36am UTC](https://discuss.elastic.co/t/try-to-use-heartbeat-to-ping-thrift-interface/108106/3 "2017-11-18T04:36:43Z")

</div>

i have try use the **'**  
it's not ok too, yaml would not handle the backslash，  
it just treat '\x80' as '\', 'x' , '8', '0' 4 char.

i will open the request later

---

<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: [December 16, 2017, 4:37am UTC](https://discuss.elastic.co/t/try-to-use-heartbeat-to-ping-thrift-interface/108106/4 "2017-12-16T04:37:16Z")

</div>

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