Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Want to use Global variable which can replace emailIDs for multiple flows.

avatar

Hi All, I am using multiple process groups each one having separate data flows. I want to use PUTEMAIL processor to send email to appropriate people in case of flow failure. Now I want to set a global variable which will hold a list of email id's to whom we need to send flow failure detail. This variable I want to use for "To" field for PUTEMAIL processor. So that "To" field will be replaced with the list of emailIDs. Here it will be my benefit that in future if any emailid need to change then we no need to update all the PUTEMAIL processor. Instead we will do modification for global variable and it will reflect for all the flows automatically. Please suggest on this.

1 ACCEPTED SOLUTION

avatar
Master Guru

You can define a variable in bootstrap.conf like java.arg.15=-Demails.to=address1,address2,address3 and then your PutEmail processors reference ${emails.to} for the to address.

Alternatively, you can also use the variable registry feature. In nifi.properties:

# external properties files for variable registry # supports a comma delimited list of file locations nifi.variable.registry.properties=

You could specify a properties file here that had a property:

emails.to=address1,address2,address3

And then reference it the same as ${emails.to}.

In either case a restart of NiFi is required to pick up changes.

View solution in original post

2 REPLIES 2

avatar
Master Guru

You can define a variable in bootstrap.conf like java.arg.15=-Demails.to=address1,address2,address3 and then your PutEmail processors reference ${emails.to} for the to address.

Alternatively, you can also use the variable registry feature. In nifi.properties:

# external properties files for variable registry # supports a comma delimited list of file locations nifi.variable.registry.properties=

You could specify a properties file here that had a property:

emails.to=address1,address2,address3

And then reference it the same as ${emails.to}.

In either case a restart of NiFi is required to pick up changes.

avatar

Thank you Very much @Bryan Bende. It worked for me.