kafkactl
kafkactl copied to clipboard
message separator for consume operation
I want to filter multiline messages by substring. Now I use key-value separator to tell awk where a new message begins, because my keys are empty. But I think this is not a robust solution.
DATE="2025-07-06T04|2025-07-06T07"
kafkactl consume my_topic --from-beginning --exit -k -s '~~' | awk "/$DATE/" RS='~~' ORS='\n\n'
Hey @Winand,
How about using -o json to format the message as json and pipe that to jq to select what you need?
Cheers, Dirk
I've thought about it and I think it's a good solution. But it would be nice to have a custom message separator to distinguish multiline messages from each other without additional tools.