# UDP, merged messages

**URL:** <https://discuss.elastic.co/t/udp-merged-messages/109856>\
**Category:** Logstash\
**Created:** [December 1, 2017, 12:39am UTC](https://discuss.elastic.co/t/udp-merged-messages/109856 "2017-12-01T00:39:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![robert-blankenship](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robert-blankenship/32/11287_2.png) [@robert-blankenship](https://discuss.elastic.co/u/robert-blankenship)\
**Post date:** [December 1, 2017, 12:39am UTC](https://discuss.elastic.co/t/udp-merged-messages/109856/1 "2017-12-01T00:39:44Z")

</div>

I have a Logstash instance set up with a simple UDP listener, and a single output to Kafka

```auto
input {
    udp {
        port => 514
        codec => line
    }
}

filter {
  grok {
    match => #stuff
    tag_on_failure => []
  }
  mutate {
    remove_field => #stuff
    rename => #stuff
    rename => #stuff
  }
}

output {
    file {
        path => /home/my-user/output.txt
    }
}

```

I am loading up messages using the command `cat test-messages.txt | nc localhost 514`

The messages might look like the following:

```auto
# test-messages.txt
eager escalate entry envelope
eager escalate entry envelope
eager escalate entry envelope
fill finish fort far
fill finish fort far
fill finish fort far
gentry gentle generation gas ghastly
gentry gentle generation gas ghastly
gentry gentle generation gas ghastly
honest hanukah honolulu hope hone 
honest hanukah honolulu hope hone
honest hanukah honolulu hope hone

```

Since each message is separated by a new line, I would expect the following messages in `output.txt`

```auto
# x3
eager escalate entry envelope
# x3
fill finish fort far
# x3
gentry gentle generation gas ghastly
# x3
honest hanukah honolulu hope hone

```

Once I look at the messages in `output.txt`, I see some _very_ weird behavior. I'm seeing a lot of funky, merged Frankenstein's monster messages:

```auto
# output.txt
eager escalate entry envelope
eager escalate entry envelope
eager escfinish fort far
fill finish fort far
fill finish gentle generation gas ghastly
gentry honest hanukah honolulu hope hone

```

As you can see, messages have merged together. Anyone know what's going on and how I can make sure my messages arrive in Kafka in one piece? 🙂

---

<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 29, 2017, 12:40am UTC](https://discuss.elastic.co/t/udp-merged-messages/109856/2 "2017-12-29T00:40:14Z")

</div>

Closed on December 29, 2017, 12:40am UTC

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