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]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Nifi extract Email Attributes

avatar
Expert Contributor

Hello

I am using Nifi to ingest my hdfs cluster with emails (.msg) and i want to be able to extract custom attributes these emails have like (From, To, Title etc..). How should i approach this?

I also want to create directories in my hdfs destination through nifi based on these attributes. Is this possible?

Thanks

Ahmad

1 ACCEPTED SOLUTION

avatar

You could use existing processors such as ExtractText for some types of emails to extract attributes which you can then use for routing. Or you could use the scripting processors and write your own code to extract features of the emails as attributes then use RouteOnAttribute. In the NiFi community there was recently work merged https://issues.apache.org/jira/browse/NIFI-1899 which looks like it will help a lot. For now, probably the best approach is to use ExecuteScript or InvokeScript to put together a quick e-mail parsing processor.

Thanks

View solution in original post

2 REPLIES 2

avatar

You could use existing processors such as ExtractText for some types of emails to extract attributes which you can then use for routing. Or you could use the scripting processors and write your own code to extract features of the emails as attributes then use RouteOnAttribute. In the NiFi community there was recently work merged https://issues.apache.org/jira/browse/NIFI-1899 which looks like it will help a lot. For now, probably the best approach is to use ExecuteScript or InvokeScript to put together a quick e-mail parsing processor.

Thanks

avatar
Expert Contributor

Thank you for your answer. These attributes are part of the metadata of the .msg file. Shouldn't the updateattributes processor be able to extract them? i tried it but it didnt work.