How to process messages strictly in the order they arrive?

This is likely caused by a race between the pipeline workers. Start Logstash with -w 1 to run a single pipeline worker and the problem should disappear.