<?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: how ot change file name moving  another location using FetchSFTP in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/389772#M247075</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/108435"&gt;@enam&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The FetchSFTP processor only supports specifying a target directory path in which the source file on the SFTP server will be moved.&amp;nbsp; It does not support the renaming of the source file during that move. When you configure the filename in the "move destination directory" it creates that filename as a directory in which it puts the source file using the value from the FlowFiles "filename" attribute.&lt;/P&gt;&lt;P&gt;Your option is to set "completion strategy to "Delete File" and then route the "success" relationship via two separate outbound connections.&amp;nbsp; One connection will continue down your existing dataflow path.&amp;nbsp; The second connection will feed an UpdateAttribute processor (used to change filename) and then a putSFTP processor to write it back the SFTP server in the new directory.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_2-1719868618129.png" style="width: 708px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41091i573A8F21107DCDA6/image-dimensions/708x414?v=v2" width="708" height="414" role="button" title="MattWho_2-1719868618129.png" alt="MattWho_2-1719868618129.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The NiFi FlowFile routed to "success" relationship in connection 1 will retain original filename.&lt;BR /&gt;The NiFi FlowFile routed to "success" relationship in connection 2 will have its original filename modified by the UpdateAttribute processor as follows before being written back to SFTP server in new folder via the putSFTP processor.&lt;BR /&gt;&lt;BR /&gt;Update Attribute configuration (click "plus" icon to add new dynamic property):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_1-1719868535096.png" style="width: 713px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41090i4B641E7C75DE3885/image-dimensions/713x497?v=v2" width="713" height="497" role="button" title="MattWho_1-1719868535096.png" alt="MattWho_1-1719868535096.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Property = filename&lt;BR /&gt;Value =&amp;nbsp;${filename:substringBeforeLast('.')}-${UUID}.${filename:substringAfterLast('.')}&lt;BR /&gt;&lt;BR /&gt;You can then auto-terminate the success relationship of the putSFTP processor.&amp;nbsp; terminating FlowFile down path of connection 2 will have no impact on FlowFile routed to connection 1.&amp;nbsp; Make sure that you set the target path in the putSFTP processor (path does not include filename).&lt;/P&gt;&lt;P&gt;Please help our community thrive. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jul 2024 21:24:45 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2024-07-01T21:24:45Z</dc:date>
    <item>
      <title>how ot change file name moving  another location using FetchSFTP</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/385785#M245833</link>
      <description>&lt;P&gt;Hi sir,&lt;/P&gt;&lt;P&gt;I am using &lt;SPAN class="dialog-header-subtitle"&gt;ListSFTP 2.0.0-M1&lt;/SPAN&gt;+FetchSFTP&amp;nbsp; processor&amp;nbsp; and move file another location. I have two issues&lt;/P&gt;&lt;P&gt;1. Every time it make a folder and inside the folder keep the file. Here is image:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="enam_1-1711873146987.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40207iA53C5CF29B3A3D5B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="enam_1-1711873146987.jpeg" alt="enam_1-1711873146987.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I need to move file using filename like filename+uniqueid.xml&lt;/P&gt;&lt;P&gt;If my file name is test.xml , I will rename file name like test++uniqueid.xml.&lt;/P&gt;&lt;P&gt;I have used&amp;nbsp; below path for move destination directiory&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/myfolder/${filename}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Here is the image of FetchSFTP :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="enam_0-1711872953352.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40206i524AF8BDF94B33FD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="enam_0-1711872953352.jpeg" alt="enam_0-1711872953352.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What is wrong of my configuration?&lt;/P&gt;&lt;P&gt;Please help me..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2024 08:19:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/385785#M245833</guid>
      <dc:creator>enam</dc:creator>
      <dc:date>2024-03-31T08:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: how ot change file name moving  another location using FetchSFTP</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/386097#M245938</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/108435"&gt;@enam&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;1. Please set the Create Directory to false to avoid the folder creation.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saquibsk_0-1712227893690.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40269iF0D38D688A291041/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saquibsk_0-1712227893690.png" alt="saquibsk_0-1712227893690.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. you can change the filename using UpdateAttribute processor by following below steps:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;2.1&lt;/STRONG&gt;:&amp;nbsp; let say your file name is "97435cb8-b8b1-4b4d-b60b-f6aa98a15ba9" and UUID is "97435cb8-b8b1-4b4d-b60b-f6aa98a15ba9"&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="saquibsk_1-1712228147812.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40270iFEB83154746629A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saquibsk_1-1712228147812.png" alt="saquibsk_1-1712228147812.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 2.2. &lt;/STRONG&gt;Now drag the UpdateAttribute name&amp;nbsp;&amp;nbsp;and writedown the below Expression Lang&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saquibsk_2-1712228356541.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40271i41A3610A69641C56/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saquibsk_2-1712228356541.png" alt="saquibsk_2-1712228356541.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;updated file name&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saquibsk_3-1712228411185.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40272i8B077875677D4FED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saquibsk_3-1712228411185.png" alt="saquibsk_3-1712228411185.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saquibsk_4-1712228533405.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40273iF54C35D48A6D6637/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saquibsk_4-1712228533405.png" alt="saquibsk_4-1712228533405.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saquibsk_5-1712228631489.png" style="width: 434px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40274i6DE8497B3C92D905/image-dimensions/434x173?v=v2" width="434" height="173" role="button" title="saquibsk_5-1712228631489.png" alt="saquibsk_5-1712228631489.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"Accept as Solution" if its work for you.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 11:04:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/386097#M245938</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-04-04T11:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: how ot change file name moving  another location using FetchSFTP</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/386222#M245971</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/108435"&gt;@enam&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Did above solution help you?&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2024 01:54:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/386222#M245971</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-04-07T01:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: how ot change file name moving  another location using FetchSFTP</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/389668#M247040</link>
      <description>&lt;P&gt;Hi Sorry for late reply.&lt;/P&gt;&lt;P&gt;It move the file to my destination folder. But it create new folder destination folder..I want to stop create folder &amp;amp; move the file to my destination folder with new unique id and the file name. Here is the configuration:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="enam_1-1719484353358.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41063i31DAC579B395E7F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="enam_1-1719484353358.png" alt="enam_1-1719484353358.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In back file it&amp;nbsp; create new folder :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="enam_2-1719484618551.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41064i7D3C35CE4972D366/image-size/medium?v=v2&amp;amp;px=400" role="button" title="enam_2-1719484618551.png" alt="enam_2-1719484618551.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But if I want to create directory false , it would not move the file to the directory. I also try add move destination directory like /home/account-to-account/${now:format('yyyMMddHHmmss')}_${filename} which also not working&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 12:12:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/389668#M247040</guid>
      <dc:creator>enam</dc:creator>
      <dc:date>2024-06-27T12:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: how ot change file name moving  another location using FetchSFTP</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/389772#M247075</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/108435"&gt;@enam&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The FetchSFTP processor only supports specifying a target directory path in which the source file on the SFTP server will be moved.&amp;nbsp; It does not support the renaming of the source file during that move. When you configure the filename in the "move destination directory" it creates that filename as a directory in which it puts the source file using the value from the FlowFiles "filename" attribute.&lt;/P&gt;&lt;P&gt;Your option is to set "completion strategy to "Delete File" and then route the "success" relationship via two separate outbound connections.&amp;nbsp; One connection will continue down your existing dataflow path.&amp;nbsp; The second connection will feed an UpdateAttribute processor (used to change filename) and then a putSFTP processor to write it back the SFTP server in the new directory.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_2-1719868618129.png" style="width: 708px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41091i573A8F21107DCDA6/image-dimensions/708x414?v=v2" width="708" height="414" role="button" title="MattWho_2-1719868618129.png" alt="MattWho_2-1719868618129.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The NiFi FlowFile routed to "success" relationship in connection 1 will retain original filename.&lt;BR /&gt;The NiFi FlowFile routed to "success" relationship in connection 2 will have its original filename modified by the UpdateAttribute processor as follows before being written back to SFTP server in new folder via the putSFTP processor.&lt;BR /&gt;&lt;BR /&gt;Update Attribute configuration (click "plus" icon to add new dynamic property):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_1-1719868535096.png" style="width: 713px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/41090i4B641E7C75DE3885/image-dimensions/713x497?v=v2" width="713" height="497" role="button" title="MattWho_1-1719868535096.png" alt="MattWho_1-1719868535096.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Property = filename&lt;BR /&gt;Value =&amp;nbsp;${filename:substringBeforeLast('.')}-${UUID}.${filename:substringAfterLast('.')}&lt;BR /&gt;&lt;BR /&gt;You can then auto-terminate the success relationship of the putSFTP processor.&amp;nbsp; terminating FlowFile down path of connection 2 will have no impact on FlowFile routed to connection 1.&amp;nbsp; Make sure that you set the target path in the putSFTP processor (path does not include filename).&lt;/P&gt;&lt;P&gt;Please help our community thrive. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 21:24:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/389772#M247075</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2024-07-01T21:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: how ot change file name moving  another location using FetchSFTP</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/389801#M247092</link>
      <description>&lt;P class="lia-indent-padding-left-30px"&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/108435"&gt;@enam&lt;/a&gt;&amp;nbsp;Have a slight mistake in my NiFi Expression Language (NEL) statement in my above post.&lt;BR /&gt;&lt;BR /&gt;Should be as follows instead:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Property = filename
Value = ${filename:substringBeforeLast('.')}-${UUID()}.${filename:substringAfterLast('.')}&lt;/LI-CODE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 20:00:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-ot-change-file-name-moving-another-location-using/m-p/389801#M247092</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2024-07-02T20:00:00Z</dc:date>
    </item>
  </channel>
</rss>

