Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

Use nested value from record as key in Kafka


Hi guys,

I have some problem with public data on Kafka. I have record to public like this:

"name": "Jess",
"surname": "Stone",
 "data": {
"mail": "",
"class": "5",
  "address": {
  "country": "Brasil",
  "city": "Rio de Janeiro"
"anotherData": {
"sex": "female",
"code": "1220"

I need set code value as key so I set it like 

Message Key Field sex
But it doesn't works, i think it is possible that it doesn't work because this value is nested-when I set for example name it works. Maybe you know how can I set these nested value from this record to Message Key Field? I tried something like this: but it doesn't work too...

Super Collaborator

Have you considered using EvaluateJSONPath to extract the value as a FlowFile attribute and then use that for your key when publishing to Kafka?