I want to replace some of the content of flowfile(based on rgex which I have) with the attribute value of attribute say var1 which is 123 (shown in image). I am doing this with Replace Text Processor in Nifi but the contents are not getting replaced instead the flow file is getting dropped.
You can use the following flow as an example to achieve the regex replacement.
The individual processor configurations are below:
GenerateFlowFile: This generates a flow file with some content. In this case, the content is This is my content
.
UpdateAttribute: This adds an attribute with key=var1
and value=123
.
ReplaceText: This looks for matches of the regex and replaces with the value of attribute var1
. So, This is my content
will be transformed to This is my 123
.
OriginalContent: This is to see the actual content before the replace. It uses a PutFile
processor.
UpdatedContent: This is to see the updated content. It uses a PutFile
processor.
Verification
After the flow has run one time, you can verify the contents by looking at the generated files.
$ cat original/5601958271012409
This is my content
$ cat updated/5601958271012409
This is my 123
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With