Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

NiFi - Extract content from AVRO FlowFile to attributes

avatar
Frequent Visitor

Hi, I have flow file with an Avro record. Is there any chance to extract one field value from this record to attribute without converting record to Json format and without using the groovy script. 

I need to extract field value from content to attribute for using it as a part of cache identifier in the further processor. 

 

Thank you.

1 ACCEPTED SOLUTION

avatar

@AntonBV,

You could give it a try with PartitionRecord, which will place the results of a RecordPath directly into a FlowFile Attribute. I am using it already on AVRO data so it should work for you as well.
PartitionRecord: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.20.0/org.apach...
Record Path: https://nifi.apache.org/docs/nifi-docs/html/record-path-guide.html

View solution in original post

2 REPLIES 2

avatar

@AntonBV,

You could give it a try with PartitionRecord, which will place the results of a RecordPath directly into a FlowFile Attribute. I am using it already on AVRO data so it should work for you as well.
PartitionRecord: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.20.0/org.apach...
Record Path: https://nifi.apache.org/docs/nifi-docs/html/record-path-guide.html

avatar
Frequent Visitor

@cotopaul,
Thank you a lot. That is exactly what I need.

AntonBV_0-1682623214387.png