Search code examples
logstashfilebeatlogstash-configuration

communication filebeat --> logstash: messages wrong order


I try to feed a csv data file to logstash using filebeat. Unfortunately the messages are out of order. Is there any way to correct this? Could this caused by TCP or any pipeline? Logstash started logstash.javapipeline / pipeline_id=>"main", "pipeline.workers"=>8

I tried: filebeat - output to console - pass filebeat - output to logstash (localhost) - logstash w/o filter; output to stdout - fail (wrong order of messages)


Solution

  • Per default order is not guaranteed in Logstash as the events in the batch can be reordered in the filter processing and some events can be processed faster than others.

    If you need to order your events you will have to change the number of pipeline.workers to 1, which means that only 1 CPU will be used to process your messages.

    Also, set pipeline.ordered to auto in logstash.yml.

    Setting pipeline.workers to 1 will make logstash process the events in the orders they are received, but since it will use only 1 CPU, it can impact the performance if you have a high rate of events per second.

    This is the part of the documentation about ordering events.