# APM through logstash TCP, Message too big

**URL:** <https://discuss.elastic.co/t/apm-through-logstash-tcp-message-too-big/175796>\
**Category:** APM\
**Created:** [April 8, 2019, 8:44am UTC](https://discuss.elastic.co/t/apm-through-logstash-tcp-message-too-big/175796 "2019-04-08T08:44:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gruselglatz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gruselglatz/32/42675_2.png) [@gruselglatz](https://discuss.elastic.co/u/gruselglatz)\
**Post date:** [April 8, 2019, 8:44am UTC](https://discuss.elastic.co/t/apm-through-logstash-tcp-message-too-big/175796/1 "2019-04-08T08:44:05Z")

</div>

My usecase APM-Agent -\> APM-Server -\> Logstash -\> Logstash -\> ES .

My Problem: Logstash -\> Logstash is via TCP json\_lines. Some APM-Messages getting json parsing errors without further explanaiton. Is it possible that my problem is the json\_lines codec?

Logstash errors:

```
[2019-04-08T10:37:32,148][WARN][logstash.codecs.jsonlines] lFilterChain\",\"function\": ...

```

I cant switch to anything else then tcp, and because tcp automaticaly switches to json\_lines. Is there a known workaround for this?

When I change my delimiter to "\0", i get the same errors.

EDIT 2: It seems like its happening when i get Errors with stack traces. -\> EDIT 3: its not only with stack traces!  
EDIT 3: With udp as transport protocol its working as expected. No jsonparse errors. But I cant use UDP, i have to use TCP!

thanks

---

<div class="post-metadata">

**Author:** ![gruselglatz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gruselglatz/32/42675_2.png) [@gruselglatz](https://discuss.elastic.co/u/gruselglatz)\
**Post date:** [April 8, 2019, 9:22am UTC](https://discuss.elastic.co/t/apm-through-logstash-tcp-message-too-big/175796/2 "2019-04-08T09:22:58Z")

</div>

Is it possible that because the problematic message is `31789` bytes long that the tcp buffer implementation in logstash cant handle this?

ref: [https://github.com/logstash-plugins/logstash-input-tcp/issues/51#issuecomment-309729030](https://github.com/logstash-plugins/logstash-input-tcp/issues/51#issuecomment-309729030)

---

<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:** [April 29, 2019, 6:44am UTC](https://discuss.elastic.co/t/apm-through-logstash-tcp-message-too-big/175796/4 "2019-04-29T06:44:02Z")

</div>

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