Support Questions

Find answers, ask questions, and share your expertise

Nifi treating newline as argument delimiter despite custom config

avatar
New Contributor

I'm having issues with ExecuteStreamCommand, I have set up the Argument Delimiter as ~ like screenshot below: 

abvincita_0-1647327485446.png

 

However when ERROR_DETAIL attribute contains newline characters (\n or %0A) apparently Nifi treats the newline as a delimiter and hence the shell script receives more than 1 arguments in the place of ERROR_DETAIL. I was expecting Nifi to use strictly just the ~ character as the argument delimiter.

 

Am I missing a different config in Nifi? Is there a way to make Nifi ignores the newline and only use the ~ as the delimiter?

4 REPLIES 4

avatar
Super Guru

Hi, @abvincita ,

 

Try using the following Command Arguments in your processor configuration:

"${ERROR_DETAIL}"~"${ERROR_CODE}"

 

Cheers,

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
New Contributor

Hi @araujo , thanks for your suggestion.

 

I tried doing that, and while it seems to make Nifi ignores the newlines indeed, the processor now throws a different error: 

ERROR: ORA-01756: quoted string not properly terminated


The strings are definitely terminated in the configuration.... The ERROR_DETAIL does contain double quotes as well, can this be affecting it?

avatar
Super Guru

@abvincita ,

 

Yes, if ERROR_DETAIL has double-quotes in it, it will have adverse effects. Does it have single-quotes too? If not, you can try using:

'${ERROR_DETAIL}'~'${ERROR_CODE}'

 

Cheers,

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
Super Guru

Hi, @abvincita ,

 

Please ignore my last post. I did a quick test using dynamic properties arguments and confirmed that it works well, regardless of the content of the attributes.

Please give this a try:

araujo_0-1647413281075.png

 

 

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.