diff --git a/modules/factorio-events-kafka-pipe/kafka-pipe.sh b/modules/factorio-events-kafka-pipe/kafka-pipe.sh index e0f5b7b..1c7aae1 100644 --- a/modules/factorio-events-kafka-pipe/kafka-pipe.sh +++ b/modules/factorio-events-kafka-pipe/kafka-pipe.sh @@ -10,12 +10,15 @@ endProcess() { exit } +# some random ID, to use as a message key +INSTANCE_ID=$(cat /proc/sys/kernel/random/uuid) + while :; do docker logs --tail 0 -f "$FACTORIO_SERVER_CONTAINER_NAME" | sed -n -e 's/^FactorioEvent: //p' | - kafkacat -P -T -b "$KAFKA_HOST" -t factorio-server-log + kafkacat -P -T -b "$KAFKA_HOST" -t factorio-server-log -k "$INSTANCE_ID" echo "Error - retrying in 10 seconds" - sleep 10 + done