<?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: Nifi Replace Text Error (Response) : Transferring to failure in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Replace-Text-Error-Response-Transferring-to-failure/m-p/315949#M226646</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/88347"&gt;@leandrolinof&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The shared bulletin is being produced by the EvaluateJsonPath processor.&lt;BR /&gt;&lt;BR /&gt;It may be helpful if you share your current ReplaceText processor configuration, sample input file (prior to ReplaceText), desired output file (post ReplaceText), and the configuration of your EvaluateJsonPath processor.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Use case details are also very helpful to understand what your end-to-end goal is here.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 18:11:19 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2021-05-06T18:11:19Z</dc:date>
    <item>
      <title>Nifi Replace Text Error (Response) : Transferring to failure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Replace-Text-Error-Response-Transferring-to-failure/m-p/315942#M226642</link>
      <description>&lt;P&gt;Good morning everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following JSON return:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"RegistrosRecebidos" : 1,&lt;BR /&gt;"RegistrosImportados" : 0,&lt;BR /&gt;"Erros" : [ "Erro registro 0: The statement has been terminated.\r\nString or binary data would be truncated in table 'Ober_HML.dbo.DB_WS_IMP_CLIENTE', column 'NOME_FANTASIA'. Truncated value: 'ADLER PELZER PERNAMBUCO IND. E COMERCIO '." ]&lt;BR /&gt;}&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By default from our supplier, it comes with some formatting. That in Nifi gives the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leandrolinof_0-1620300724595.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/31117i3758AEA0D2EE7BA9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leandrolinof_0-1620300724595.png" alt="leandrolinof_0-1620300724595.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Follow my flow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leandrolinof_1-1620300781412.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/31118i8EEDCB447369FCDA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leandrolinof_1-1620300781412.png" alt="leandrolinof_1-1620300781412.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I do to solve this problem in Nifi?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use ReplaceText for this but I have not been successful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 11:40:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-Replace-Text-Error-Response-Transferring-to-failure/m-p/315942#M226642</guid>
      <dc:creator>leandrolinof</dc:creator>
      <dc:date>2021-05-06T11:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Replace Text Error (Response) : Transferring to failure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Replace-Text-Error-Response-Transferring-to-failure/m-p/315949#M226646</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/88347"&gt;@leandrolinof&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The shared bulletin is being produced by the EvaluateJsonPath processor.&lt;BR /&gt;&lt;BR /&gt;It may be helpful if you share your current ReplaceText processor configuration, sample input file (prior to ReplaceText), desired output file (post ReplaceText), and the configuration of your EvaluateJsonPath processor.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Use case details are also very helpful to understand what your end-to-end goal is here.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 18:11:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-Replace-Text-Error-Response-Transferring-to-failure/m-p/315949#M226646</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2021-05-06T18:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Replace Text Error (Response) : Transferring to failure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Replace-Text-Error-Response-Transferring-to-failure/m-p/315975#M226659</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp; Thank you for your help,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is all my flow:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leandrolinof_0-1620331869054.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/31121i8518B8980B578E28/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leandrolinof_0-1620331869054.png" alt="leandrolinof_0-1620331869054.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I send a JSON like this :&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"User": "user",&lt;BR /&gt;"Key": "ABC",&lt;BR /&gt;"Table": "Table",&lt;BR /&gt;"Rows": [&lt;BR /&gt;{&lt;BR /&gt;"CODIGO": 1,&lt;BR /&gt;"NOME": "ABC REPRESENTACOES LTDA",&lt;BR /&gt;"NOME_FANTASIA": "PEDRO LIMA",&lt;BR /&gt;"ENDERECO": "RUA SANTOS, 178",&lt;BR /&gt;"BAIRRO": "",&lt;BR /&gt;"CIDADE": "SAO PAULO",&lt;BR /&gt;"UF": "SP",&lt;BR /&gt;"CEP": "11008999",&lt;BR /&gt;"TELEFONE": "(11) 99887 1234",&lt;BR /&gt;"EMAIL": "pedro.lima@email.com",&lt;BR /&gt;"FUNCAO": "REPRESENTANTE",&lt;BR /&gt;"CODIGO_SUPERIOR": "",&lt;BR /&gt;"CNPJ": "",&lt;BR /&gt;"INSCRICAO_ESTADUAL": "",&lt;BR /&gt;"NRO_CONTRATO": "8918-A",&lt;BR /&gt;"NRO_REG_EMPREGADO": "",&lt;BR /&gt;"DATA_CONTRATACAO": "2018/06/28",&lt;BR /&gt;"DATA_DESLIGAMENTO": "",&lt;BR /&gt;"SITUACAO": "ATIVO",&lt;BR /&gt;"REGIAO": "SP"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And&amp;nbsp;at some point the API called returns an error,&amp;nbsp;that at some point I need to deal with in order to insert the error in our database.&amp;nbsp;This error is expected in the HTTP response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Follows the configuration of the processors:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ReplaceText =&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leandrolinof_1-1620332300647.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/31122i7C3F184B4F0D8BD8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leandrolinof_1-1620332300647.png" alt="leandrolinof_1-1620332300647.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;EvaluateJsonPath =&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leandrolinof_2-1620332356203.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/31123iF384EB709447AD1C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leandrolinof_2-1620332356203.png" alt="leandrolinof_2-1620332356203.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is Response Before Replace Text =&amp;nbsp;&lt;/P&gt;&lt;P&gt;{"RegistrosRecebidos":1,"RegistrosImportados":0,"Erros":["Erro registro 0: The statement has been terminated.\r\nString or binary data would be truncated in table \u0027Ober_HML.dbo.DB_WS_IMP_CLIENTE\u0027, column \u0027NOME_FANTASIA\u0027. Truncated value: \u0027ADLER PELZER PERNAMBUCO IND. E COMERCIO \u0027."]}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need is to take the value of the "Errors" property and save it in my database, only when trying to do this with EvaluateJsonPath it returns the following error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leandrolinof_3-1620385699582.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/31129iDD2BD6B584242048/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leandrolinof_3-1620385699582.png" alt="leandrolinof_3-1620385699582.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this reason I am trying to use ReplaceText but also without success.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know if I managed to be clear enough in my doubt.&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 11:10:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-Replace-Text-Error-Response-Transferring-to-failure/m-p/315975#M226659</guid>
      <dc:creator>leandrolinof</dc:creator>
      <dc:date>2021-05-07T11:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Replace Text Error (Response) : Transferring to failure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Replace-Text-Error-Response-Transferring-to-failure/m-p/315985#M226664</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/88347"&gt;@leandrolinof&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The "&lt;STRONG&gt;EvaluateJsonPath&lt;/STRONG&gt;" processor you shared has the configured destination as a FlowFile-Attribute and thus leaves the content of the FlowFile unchanged.&lt;BR /&gt;&lt;BR /&gt;So if FlowFile Attribute is where you want this parsed output to reside, you could use "&lt;STRONG&gt;ExtractText&lt;/STRONG&gt;" [1] as an alternative solution.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_0-1620392099103.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/31131iDDFD4F612C9D2B4F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MattWho_0-1620392099103.png" alt="MattWho_0-1620392099103.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The used value here would be:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;.*Erros":\[(.*)\].*&lt;/LI-CODE&gt;&lt;P&gt;This has only 1 capture group which is for the content you are trying to extract.&amp;nbsp; That content is then added to the FlowFile in a new FlowFile attribute based on the property name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you instead want to replace the content of your FlowFile with only the portion of the original content you are trying to extract, you could use the "&lt;STRONG&gt;ReplaceText&lt;/STRONG&gt;" [2] processor.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_1-1620392199474.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/31132i65419E0AC05A50F8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MattWho_1-1620392199474.png" alt="MattWho_1-1620392199474.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The used Java regex "Search value" here would be:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(.*Erros":\[)(.*)(\].*$)&lt;/LI-CODE&gt;&lt;P&gt;Which breaks source content into 3 capture groups so regex matches entire content and capture group 2 matches on the string output you are looking for.&lt;BR /&gt;So "Replacement Value" is simply set to "$2" so that entire content is replaced with just contents of capture group 2.&lt;BR /&gt;&lt;BR /&gt;[1]&amp;nbsp;&lt;A href="http://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.13.2/org.apache.nifi.processors.standard.ExtractText/index.html" target="_blank"&gt;http://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.13.2/org.apache.nifi.processors.standard.ExtractText/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;[2]&amp;nbsp;&lt;A href="http://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.13.2/org.apache.nifi.processors.standard.ReplaceText/index.html" target="_blank"&gt;http://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.13.2/org.apache.nifi.processors.standard.ReplaceText/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you found this help you with your question, please take a moment to login and click accept on this solution.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 13:03:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-Replace-Text-Error-Response-Transferring-to-failure/m-p/315985#M226664</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2021-05-07T13:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi Replace Text Error (Response) : Transferring to failure</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-Replace-Text-Error-Response-Transferring-to-failure/m-p/315990#M226669</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the time available for my problem, the "ExtractText" worked perfectly for my case and the data was saved in my database.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Grateful.&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 18:02:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-Replace-Text-Error-Response-Transferring-to-failure/m-p/315990#M226669</guid>
      <dc:creator>leandrolinof</dc:creator>
      <dc:date>2021-05-07T18:02:55Z</dc:date>
    </item>
  </channel>
</rss>

