Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Nifi extract Email Attributes

Solved Go to solution

Nifi extract Email Attributes

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

Accepted Solutions

Re: Nifi extract Email Attributes

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

2 REPLIES 2

Re: Nifi extract Email Attributes

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

Re: Nifi extract Email Attributes

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.