Support Questions
Find answers, ask questions, and share your expertise

Error when referencing flowfile attribute in regex in ReplaceText

Contributor

I'm trying to use ReplaceText to remove x number of lines from the top of a flowfile based on a flowfile attribute.  I'm using the following regex but ReplaceText says its invalid:

 

^(.*?\n){${skip_lines}}

 

 It seems like I should be able to reference a flowfile attribute from regex according to this question but I just get an error.  Any idea how I should be doing this?  My full config is below:

ariffle_2-1603899763610.png

 

1 REPLY 1

Re: Error when referencing flowfile attribute in regex in ReplaceText

Contributor

This issue appears to be related to https://issues.apache.org/jira/browse/NIFI-4417

 

I also tried using UpdateAttribute to create my regex in an attribute, then use the attribute as the Search Value in ReplaceText, but that appears to have the same issue of NiFi attributes not getting evaluated properly in the Search Value.