# Carapted json files if using TCP instead UDP

**URL:** <https://discuss.elastic.co/t/carapted-json-files-if-using-tcp-instead-udp/193106>\
**Category:** Logstash\
**Created:** [July 31, 2019, 11:29am UTC](https://discuss.elastic.co/t/carapted-json-files-if-using-tcp-instead-udp/193106 "2019-07-31T11:29:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zakabluk](https://avatars.discourse-cdn.com/v4/letter/z/8baadc/32.png) [@zakabluk](https://discuss.elastic.co/u/zakabluk)\
**Post date:** [July 31, 2019, 11:29am UTC](https://discuss.elastic.co/t/carapted-json-files-if-using-tcp-instead-udp/193106/1 "2019-07-31T11:29:18Z")

</div>

\*\*\*Logstash 7.2 in docker container.  
For test I used simple configuration.  
input {  
tcp {  
port =\> 5959  
codec =\> json  
}  
}  
output {  
amazon\_es  
}

And my logs in Kibana has tag: \_jsonparsefailure .  
When I used udp instead tcp  
input {  
udp {  
port =\> 5959  
codec =\> json  
}  
}  
output {  
amazon\_es  
}  
My logs in kibana without some carapted data. I linked it whith statment that udp has:  
bufer\_size and quequ\_size  
May when I sent log by one big file (500Kb ~ 18000 rows) to tcp input, it can not get time for parsing all file, and did corrupted json with clipped messages and tags: \_jsonparsefailure.  
Perhaps for udp in this time used bufer and quequ which allowed take all file and processed.  
For avoid situation with clipped measges and tags: \_jsonparsefailure I tried to used logstesh.yml  
queue.type: persisted  
queue.max\_bytes: 100mb  
but it not help and how i noticed, if I got info from apiport 9600:  
`curl -XGET 'logstash:9600/_node/stats'`  
**"queue"**  **: {**

```
**"events"**  **:** 0 **,**

**"capacity"**  **: {**

**"max_queue_size_in_bytes"**  **:** 104857600 **,**

**"queue_size_in_bytes"**  **:** 47839 **,**

**"page_capacity_in_bytes"**  **:** 67108864 **,**
 **"max_unread_events"**  **:** 0

```

queue\_size\_in\_bytes" - increase after every receive logs. Maybe quequ not work?

---

<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:** [August 28, 2019, 11:29am UTC](https://discuss.elastic.co/t/carapted-json-files-if-using-tcp-instead-udp/193106/2 "2019-08-28T11:29:18Z")

</div>

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