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.

How to customize email subject in Apache NiFI Putemail processor?

Solved Go to solution

How to customize email subject in Apache NiFI Putemail processor?

Contributor

I am running Apache NiFI. My use case is to monitor the file transfer process (GetFile to PutHDFS) and send an email whenever their is an error.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to customize email subject in Apache NiFI Putemail processor?

Contributor

Hi,

the PutEmail Processor supports the NIFI expression language for the parameter Subject.

That means you can access all the attributes of your flow file and all your custom attributes or variables that you defined within the flow.

To have a custom subject in your PutEmail processor for the error-handling case, you should connect the PutHDFS (or GetFile or both) processor to the PutEmail Processor for the failure path and configure the PutEmail processor.

An example for a custom Subject could be:

'Hello from '${hostname}' the file '${filename}' caused an error at '${now}

More Examples and some guidelines for the Nifi Expression Language are listed here:

https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html

4 REPLIES 4

Re: How to customize email subject in Apache NiFI Putemail processor?

Contributor

Hi,

the PutEmail Processor supports the NIFI expression language for the parameter Subject.

That means you can access all the attributes of your flow file and all your custom attributes or variables that you defined within the flow.

To have a custom subject in your PutEmail processor for the error-handling case, you should connect the PutHDFS (or GetFile or both) processor to the PutEmail Processor for the failure path and configure the PutEmail processor.

An example for a custom Subject could be:

'Hello from '${hostname}' the file '${filename}' caused an error at '${now}

More Examples and some guidelines for the Nifi Expression Language are listed here:

https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html

Re: How to customize email subject in Apache NiFI Putemail processor?

Contributor

Thanks for your reponse, it helped.

Re: How to customize email subject in Apache NiFI Putemail processor?

Contributor

Glad that it helped. Could you please klick to accept the above answer, so that others see that this is the solution. Thanks! :)

Re: How to customize email subject in Apache NiFI Putemail processor?

Contributor

Hi Peter,

I already did that. Am I still missing something?

Don't have an account?
Coming from Hortonworks? Activate your account here