UDP, merged messages

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

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:

# 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

# 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:

# 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? :slight_smile:

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