James, I think you will want to take a look at ReplaceTextWithMapping [1] so you can look up the mapping file and then inject the matching value into the JSON content (or an attribute) and route accordingly. You can also use SimpleCsvFileLookupService [2] or ScriptedLookupService [3] if you treat the incoming data as NiFi “records”.
[1] https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.4.0/org.apache.nifi.processors.standard.ReplaceTextWithMapping/index.html [2] https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-lookup-services-nar/1.4.0/org.apache.nifi.lookup.SimpleCsvFileLookupService/index.html [3] https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-scripting-nar/1.4.0/org.apache.nifi.lookup.script.ScriptedLookupService/index.html Andy LoPresto [email protected] [email protected] PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4 BACE 3C6E F65B 2F7D EF69 > On Oct 17, 2017, at 12:02 PM, James McMahon <[email protected]> wrote: > > My customers will be posting alerts I must route to a mail distribution > system. These alerts will contain a warning or error message, and they will > contain a tag such as NIFI dictating the audience for the alerts. > > The customers want to manage the audience in a simple configurable system csv > file, something like this: > NIFI,12345 > NIFI, 891011 > CONF,666666 > APP_A,987654 > APP_B,11111 > APP_B,22222 > The system file allows them to easily modify their distribution lists. The > tags indicate the intended recipient group, the second parm is the ID for the > intended recipient - a value known to the mail system > > The customer will POST a simple JSON object to NiFi whenever required on a > specific port. The posted json will include the tags for the groups they want > the mail message alert to reach - NIFI, CONF, etc etc. The post will also > include the alert message and other information. > > How can I set up a workflow that will read from the system file and merge the > appropriate distribution list of recipients into the JSON each time I receive > a posted JSON alert and based on the tag(s) embedded in the incoming JSON? > > Thanks very much for your assistance.
signature.asc
Description: Message signed with OpenPGP using GPGMail
