Why kafka event key must be unique?

I read the following from the manual. However, i could not seem to find this requirement from apache kafka documentation? We would like to use hostname + source filename to be kafka event key, which is definitely not unique. something like the following:
key: ['beat.hostname', 'source']

key edit

Optional Kafka event key. If configured, the event key must be unique and can be extracted from the event using a format string.

i believe the documentation is incorrect,
FYI: I set the following key and it works fine.
key: '%{[beat.hostname]}+%{[source]}',

Thanks for pointing this out! I think you're right; here is a stackoverflow post with a useful discussion about key uniqueness. If strict ordering of the events is needed, a fixed key may be desirable, but it shouldn't be necessary in general.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.