- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to customize email subject in Apache NiFI Putemail processor?
- Labels:
-
Apache NiFi
Created 02-21-2017 07:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created 02-21-2017 08:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created 02-21-2017 08:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created 02-21-2017 10:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reponse, it helped.
Created 02-21-2017 10:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Glad that it helped. Could you please klick to accept the above answer, so that others see that this is the solution. Thanks! 🙂
Created 02-21-2017 12:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Peter,
I already did that. Am I still missing something?
