Search code examples
apache-nifi

Apache NiFi. add new CSV field based on existing with modification


I have .csv file with several fields. One of them (for example 3th) contains email. How can I add additional filed that will contain only serverName from email field?

Example:

input:

01;city;name@servername.com;age;

result:

01;city;name@servername.com;age;servername;

I guess it possible through ReplaceText processor, but I can't choose correct value in "Search Value" and "Replacement Value" fields.


Solution

  • You can convert your flowfile, to a record with the help of ConvertRecord. It allows you to pass to a JSON (or something else) format to whatever you prefer. Then you can add a new field, like the following, with an UpdateRecordProcessor:

    UpdateRecird

    I recommend you the following reading: