Hi all,
I’m using the Amazon EventBridge Sink Connector for Kafka Connect to push messages into EventBridge.
My Kafka message looks like this:
{
“headers”: {
“country”: “US”,
“channel”: “REDACTED_CHANNEL”,
“processType”: “REDACTED_PROCESS_TYPE”
},
“payload”: {
“date”: “01/01/2025”,
“address”: “JOE ST 00000”,
“customerId”: “REDACTED_CUST_ID”,
“accountNumber”: “REDACTED_ACC_NUM”
}
}
But in EventBridge, it appears wrapped inside a value
field like this:
“detail”: {
“topic”: “test_topic2”,
“partition”: “1”,
“offset”: “28”,
“timestamp”: “1749142570349”,
“timestampType”: “CreateTime”,
“key”: “18”,
“value”: {
“headers”: { … },
“payload”: { … }
}
}
What I want instead:
“detail”: {
“topic”: “test_topic2”,
“partition”: “1”,
“offset”: “28”,
“timestamp”: “1749142570349”,
“timestampType”: “CreateTime”,
“key”: “18”,
“headers”: { … },
“payload”: { … }
}
Connector Config:
{
“name”: “EventBridge_POC”,
“connector.class”: “software.amazon.event.kafkaconnector.EventBridgeSinkConnector”,
“topics”: “test_topic2”,
“value.converter”: “org.apache.kafka.connect.json.JsonConverter”,
“value.converter.schemas.enable”: “false”,
“aws.eventbridge.source”: “gravity”,
“aws.eventbridge.detail.types”: “gravity.Undate”,
…
}
Is there a way to flatten the Kafka message or re-map the structure so that headers
and payload
aren’t inside value
, but are instead top-level fields within the detail
section in EventBridge?
Any help would be appreciated!