<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Replace Text search with large file in NIFI in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replace-Text-search-with-large-file-in-NIFI/m-p/176785#M72834</link>
    <description>&lt;P&gt;@Shu : There was a culprit record ending up with new line. Thanks for assisting. escapeJson() is working perfect now. thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Dec 2017 05:32:24 GMT</pubDate>
    <dc:creator>rustam_kapuria</dc:creator>
    <dc:date>2017-12-26T05:32:24Z</dc:date>
    <item>
      <title>Replace Text search with large file in NIFI</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replace-Text-search-with-large-file-in-NIFI/m-p/176781#M72830</link>
      <description>&lt;A href="http://record-1" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;/A&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Greetings!&lt;/P&gt;&lt;P&gt;I am using NIFI (1.2.0) &amp;amp; struggling with Replace text processor to bring record in a single line,as for now it split a record in 2 line. &lt;BR /&gt;Input record (record-1.png) has Description &amp;amp; filed Value, I want to bring value only in a single line which is replaced by pipe symbol (|). But it split record in 2 lines (split_record.png)&lt;BR /&gt;I am using following option for Replace Text ( replace-text.png)&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="46415-vle6q.png" style="width: 1256px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/19647iAC6CA9D0097E5213/image-size/medium?v=v2&amp;amp;px=400" role="button" title="46415-vle6q.png" alt="46415-vle6q.png" /&gt;&lt;/span&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/46412-record-1.png" target="_blank"&gt;record-1.png&lt;/A&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/46413-replace-text.png" target="_blank"&gt; &lt;BR /&gt;replace-text.png&lt;/A&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/46416-split-record.png" target="_blank"&gt; &lt;BR /&gt;split-record.png&lt;/A&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="46414-apqew.png" style="width: 1256px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/19648iCBEE91B966731B53/image-size/medium?v=v2&amp;amp;px=400" role="button" title="46414-apqew.png" alt="46414-apqew.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 09:52:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replace-Text-search-with-large-file-in-NIFI/m-p/176781#M72830</guid>
      <dc:creator>rustam_kapuria</dc:creator>
      <dc:date>2019-08-18T09:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Text search with large file in NIFI</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replace-Text-search-with-large-file-in-NIFI/m-p/176782#M72831</link>
      <description>&lt;P&gt;@Shu: thanks for taking out time. I tired this option, unfortunately  it did not work.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Dec 2017 03:34:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replace-Text-search-with-large-file-in-NIFI/m-p/176782#M72831</guid>
      <dc:creator>rustam_kapuria</dc:creator>
      <dc:date>2017-12-23T03:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Text search with large file in NIFI</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replace-Text-search-with-large-file-in-NIFI/m-p/176783#M72832</link>
      <description>&lt;P&gt;@Shu : All attributes are in single line. &lt;A href="https://community.cloudera.com/legacyfs/online/attachments/46424-replacement-value.png"&gt;replacement-value.png&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Dec 2017 05:44:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replace-Text-search-with-large-file-in-NIFI/m-p/176783#M72832</guid>
      <dc:creator>rustam_kapuria</dc:creator>
      <dc:date>2017-12-23T05:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Text search with large file in NIFI</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replace-Text-search-with-large-file-in-NIFI/m-p/176784#M72833</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/52176/rustamkapuria.html" nodeid="52176" target="_blank"&gt;@Rustam kapuria&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I suspect in your input record having &lt;STRONG&gt;\n&lt;/STRONG&gt; for &lt;STRONG&gt;one of the value&lt;/STRONG&gt;, so when we do &lt;STRONG&gt;Replace Text processor&lt;/STRONG&gt; the resultant content is writing into 2 line.&lt;/P&gt;&lt;P&gt;To resolve this issue you need to use &lt;STRONG&gt;escape json function&lt;/STRONG&gt; in replace text processor.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Replacement Value
&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;${ID_NO}|${CHANGE_TITLE:escapeJson()}&lt;/PRE&gt;&lt;P&gt;Same way as above you need to mention escape json function where you are having \n in json message.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="45564-replacetext.png" style="width: 1710px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/19643i187925DCF51C77B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="45564-replacetext.png" alt="45564-replacetext.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Make sure which json value having \n in it and use escapeJson function for that attribute in Replace Text processor.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Refer below link for more details&lt;/P&gt;&lt;P&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#escapejson" target="_blank" rel="nofollow noopener noreferrer"&gt;https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#escapejson&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Here is what i tried:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Input record:-&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{"ID_NO": "8.92" ,"TITLE": "HCC\n"}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Evaluate Json Path:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Destination
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;flowfile-attribute&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Return Type
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;auto-detect&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Path Not Found Behavior
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;ignore&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Null Value Representation
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;empty string&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;CHANGE_TITLE
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;$.TITLE&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;ID_NO
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;$.ID_NO&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Output of Eval json path processor:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="45561-eval-json.png" style="width: 952px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/19644i4ECB81AF00A35DDE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="45561-eval-json.png" alt="45561-eval-json.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Even though i'm having &lt;STRONG&gt;\n&lt;/STRONG&gt; after &lt;STRONG&gt;HCC&lt;/STRONG&gt; for CHANGE_TITLE,&lt;STRONG&gt;\n is not viewed in attributes tab&lt;/STRONG&gt; but when we use &lt;STRONG&gt;CHANGE_TITLE&lt;/STRONG&gt; in &lt;STRONG&gt;Replace Text processor it will replace the value with new line.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Replace text processor Configs without escapeJson Function:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Search Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;(?s)(^.*$)&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;${ID_NO}|${CHANGE_TITLE}&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Maximum Buffer Size
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;10 MB&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Strategy
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Always Replace&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Evaluation Mode
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Output of replace Text processor without escapejson function:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="45562-output.png" style="width: 683px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/19645i605FB9625B0F8EBF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="45562-output.png" alt="45562-output.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see the new line is appeared after replace text processor.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Replace text processor Configs with escapeJson Function:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Search Value&lt;/P&gt;&lt;PRE&gt;(?s)(^.*$)&lt;/PRE&gt;&lt;P&gt;Replacement Value&lt;/P&gt;&lt;PRE&gt;${ID_NO}|${CHANGE_TITLE:escapeJson()}&lt;/PRE&gt;&lt;P&gt;Maximum Buffer Size&lt;/P&gt;&lt;PRE&gt;10 MB&lt;/PRE&gt;&lt;P&gt;Replacement Strategy&lt;/P&gt;&lt;PRE&gt;Always Replace&lt;/PRE&gt;&lt;P&gt;Evaluation Mode&lt;/P&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Output of replace Text processor with escapejson function:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="45563-output.png" style="width: 735px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/19646i16B453CB60DC09DC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="45563-output.png" alt="45563-output.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;as you can see the output is in &lt;STRONG&gt;one line because we have used escapeJson function &lt;/STRONG&gt;so the processor escaped the&lt;STRONG&gt; \n&lt;/STRONG&gt; and replaced whole content into one line.&lt;/P&gt;&lt;P&gt;Try with escapejson function, if the issue is still not resolved let me know..!!&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 09:51:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replace-Text-search-with-large-file-in-NIFI/m-p/176784#M72833</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T09:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Text search with large file in NIFI</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replace-Text-search-with-large-file-in-NIFI/m-p/176785#M72834</link>
      <description>&lt;P&gt;@Shu : There was a culprit record ending up with new line. Thanks for assisting. escapeJson() is working perfect now. thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2017 05:32:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replace-Text-search-with-large-file-in-NIFI/m-p/176785#M72834</guid>
      <dc:creator>rustam_kapuria</dc:creator>
      <dc:date>2017-12-26T05:32:24Z</dc:date>
    </item>
  </channel>
</rss>

