Closed pksu closed 5 years ago
We can add this, I am just wondering your use case: do you need to send flows to a specific partition? I would imagine keying via specific attributes (eg: router address).
Personally, I'd use this to partition messages by device (so eg. use sflow listening port).
Just stumbled upon the use case where I need to identify port through inif/outif + device
. I could extract device identifier from key if it was there. Currently, there's no other way to identifiy device when consuming from kafka I think.
EDIT: "router addr" field
I think I will add the flag to set a key using the proto fields (which could also take something static).
Example:
-kafka.key example-%inif-%outif
That would IMO solve every issue I can come up with right now 👍
Overdue but added the feature in GoFlow v3: https://github.com/cloudflare/goflow/blob/master/transport/kafka.go#L49
Sorry for taking so long to reply. Thanks for your contribution. It helped me.
Introduce a new command line switch to enable string based Kafka key (that is disabled by default).