nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Asanka Sanjaya Herath <angal...@gmail.com>
Subject Re: ReplaceText processor - $ symbol escaping done incorrectly
Date Tue, 04 Oct 2016 06:38:53 GMT
@james, Yes that was the problem. I changed "Regex Replace" to "Always
Replace" and it worked fine. Thanks so much for the help.

On Sat, Oct 1, 2016 at 12:27 AM, James Wing <jvwing@gmail.com> wrote:

> In your ReplaceText processor, is the Replacement Strategy property set to
> the default "Regex Replace"?  You might try "Always Replace" or changing
> the Search Value to ".*" (without quotes).  I suspect it is escaping your $
> as part of processing the regex.
>
>
> Thanks,
>
> James
>
> On Fri, Sep 30, 2016 at 4:57 AM, Asanka Sanjaya Herath <angal.sh@gmail.com
> > wrote:
>
>> Hi,
>>
>> I'm using Replace text processor[1] to build a json in my flow file.
>>
>> Flow file has following attribute:
>>
>>
>> *messageId: 001201d20dd3$7bcdc870$73695950$@xx.yy.co <http://xx.yy.co>*
>>
>> Replace text processor "Replacement Value":
>>
>> *{*
>> *"messageId" : "${messageId}"*
>> *}*
>>
>> And all other properties are set to default values.
>>
>> So that I'm expecting the flow file content output to be this:
>>
>> *{*
>> *"messageId" : "001201d20dd3$7bcdc870$73695950$@xx.yy.co
>> <http://xx.yy.co>"*
>> *}*
>>
>> ​But it actually is:
>> *{*
>> * "messageId" : "001201d20dd3\$7bcdc870\$73695950\$@integramicro.co.in
>> <http://integramicro.co.in>"*
>> *}*
>> ​
>> All $ characters are combined with a \ character. Can someone help me to
>> get rid of these slashes? Any help would be highly appreciated.
>>
>> ​[1]. https://github.com/apache/nifi/blob/rel/nifi-1.0.0/nifi-nar-
>> bundles/nifi-standard-bundle/nifi-standard-processors/src/
>> main/java/org/apache/nifi/processors/standard/ReplaceText.java​
>>
>> ​​
>>
>> --
>> Thanks,
>> Regards,
>> ASH
>>
>
>


-- 
Thanks,
Regards,
ASH

Mime
View raw message