kafka pipe working!!!!!!!!!!!!!!!!!
lots of experiments too - to be deleted
This commit is contained in:
parent
1c9f415d01
commit
26626263d3
13 changed files with 506 additions and 7 deletions
21
modules/factorio-events-kafka-pipe/kafka-pipe.sh
Normal file
21
modules/factorio-events-kafka-pipe/kafka-pipe.sh
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
# Pipe Docker logs from a Factorio server to a Kafka topic
|
||||
|
||||
echo "Piping logs from $FACTORIO_SERVER_CONTAINER_NAME to $KAFKA_HOST"
|
||||
|
||||
trap endProcess SIGINT
|
||||
endProcess() {
|
||||
echo "Exiting Factorio Events Kafka Pipe"
|
||||
exit
|
||||
}
|
||||
|
||||
while :; do
|
||||
docker logs --tail 0 -f "$FACTORIO_SERVER_CONTAINER_NAME" |
|
||||
sed -n -e 's/^FactorioEvent: //p' |
|
||||
kafkacat -P -b "$KAFKA_HOST" -t factorio-server-log
|
||||
|
||||
echo "Error - retrying in 10 seconds"
|
||||
|
||||
sleep 10
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue