How to reset Offsets

Hi

I am using cp-kafka:3.2.0 in docker, I need to reset offsets for all my group-id created in kafka. I am using below coomand but It’s not working

kafka-consumer-groups --bootstrap-server localhost:9092 --group logstash --reset-offsets --shift-by -2 --execute --topic topic-logstash
Exception in thread “main” joptsimple.UnrecognizedOptionException: reset-offsets is not a recognized option
at joptsimple.OptionException.unrecognizedOption(OptionException.java:108)
at joptsimple.OptionParser.handleLongOptionToken(OptionParser.java:510)
at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:56)
at joptsimple.OptionParser.parse(OptionParser.java:396)
at kafka.admin.ConsumerGroupCommand$ConsumerGroupCommandOptions.(ConsumerGroupCommand.scala:531)
at kafka.admin.ConsumerGroupCommand$.main(ConsumerGroupCommand.scala:47)
at kafka.admin.ConsumerGroupCommand.main(ConsumerGroupCommand.scala)

Please someone guide me,

I’d suggest using a latest version of Kafka container, but make sure you use correct hyphens and no spaces in your arguments. Run kafka-consumer-groups on its own, and look at the supported arguments. Also do dry run rather than immediately execute.

Your command looks correct, otherwise.

Note: In an effort to make the forum more organized, your error is unrelated to Kafka Connect.