Last active
July 15, 2019 19:28
-
-
Save dmerrick/9296f0bc7a882cb3e0544ceaf3139106 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
env="stage" | |
region="us-west-2" | |
old_group="webhooks_" | |
new_group="webhooks" | |
topic="fulfillment-events" | |
kafka_ns="team-fleet" | |
kafka_cluster="kafka-fulfillment-client" | |
kafka_url="${kafka_cluster}.${kafka_ns}.svc.${env}.${region}.aws.k8s:9092" | |
#execute="--execute" | |
execute="--dry-run" | |
###################### | |
kafka-consumer-groups --bootstrap-server ${kafka_url} --describe --group ${old_group} | \ | |
grep "${topic}" | \ | |
awk '{print $2, $3}' | \ | |
sed \ | |
-e "s/ / --reset-offsets --to-offset /" \ | |
-e "s/^/kafka-consumer-groups --bootstrap-server ${kafka_url} --group ${new_group} ${execute} --topic ${topic}:/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment