<?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: Apache Nifi in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Apache-Nifi/m-p/325312#M229602</link>
    <description>&lt;P&gt;Hey Matt,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for you advise. I have followed the below approach and worked fine for my issue.&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;${absolute.path:getDelimitedField('5','/')}&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Sep 2021 06:52:55 GMT</pubDate>
    <dc:creator>Cloud_era</dc:creator>
    <dc:date>2021-09-26T06:52:55Z</dc:date>
    <item>
      <title>Apache Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-Nifi/m-p/325202#M229556</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;I need help in geting the below issue fixed.&lt;/P&gt;&lt;P&gt;I have ftp server and in the ftp server i have a path where we will keep our daily files in a folder&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Path: /user/Mahesh/test&lt;/P&gt;&lt;P&gt;Folder under the path : 202100923,20210924&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i need to transfer the files and the folders and place them in s3 bucket&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do i get the folder name. Since i have so many folders do the below command work in update attribute processor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;${absolute.path:getDelimitedField('4','/')}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please advise any other way to extract folder name. Remember this folder name changes daily. and&amp;nbsp; can have&amp;nbsp; multiple folders also at a time.&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>Fri, 24 Sep 2021 07:16:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-Nifi/m-p/325202#M229556</guid>
      <dc:creator>Cloud_era</dc:creator>
      <dc:date>2021-09-24T07:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Apache Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-Nifi/m-p/325255#M229574</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/92210"&gt;@Cloud_era&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me see if I understand your use case fully.&lt;BR /&gt;&lt;BR /&gt;You are using the listFTP and FetchFTP processor or the GetFTP processor to pull in files from your FTP server.&lt;BR /&gt;In the ListFTP or GetFTP processor you have configured the path as "/&lt;STRONG&gt;user/Mahesh/test&lt;/STRONG&gt;" and have set "&lt;STRONG&gt;Search Recursively&lt;/STRONG&gt;" to true so that you pull files found in sub directories including "&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;202100923&lt;/STRONG&gt; and &lt;STRONG&gt;20210924&lt;/STRONG&gt;".&amp;nbsp; If you are using the GetFTP processor, you should switch to the List and Fetch processor if running on a NiFi cluster.&amp;nbsp; Also keep in mind that the List/Fetch FTP processors are much newer and provide more configuration options/capabilities not found in the legacy GetFTP processor.&lt;BR /&gt;&lt;BR /&gt;The GetFTP processor creates a FlowFile Attribute "&lt;STRONG&gt;absolute.path&lt;/STRONG&gt;" that contains the full path to the file that is consumed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The ListFTP processor creates a FlowFile Attribute "&lt;STRONG&gt;path&lt;/STRONG&gt;" that contains the full path to the file that will&amp;nbsp; consumed by fetchFTP.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So you end up in your example with the above attributes set with:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;/user/Mahesh/test/202100923&lt;BR /&gt;/user/Mahesh/test/20210924&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;using the NiFi Expression Language statement "&lt;STRONG&gt;${absolute.path:getDelimitedField('4','/')}&lt;/STRONG&gt;" and above examples, what you would have returned is "&lt;STRONG&gt;test&lt;/STRONG&gt;" since that is the 4 delimited field.&lt;BR /&gt;Field 1 = blank&lt;BR /&gt;Field 2 = user&lt;BR /&gt;Field 3 = Mahesh&lt;BR /&gt;Field 4 = test&lt;BR /&gt;Field 5 = 20210924&lt;BR /&gt;&lt;BR /&gt;Field 1 is blank because you set your delimiter as "/" and the string starts with a "/".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So setting this to "&lt;STRONG&gt;${absolute.path:getDelimitedField('5','/')}&lt;/STRONG&gt;" based on your examples would return either&amp;nbsp;"&lt;STRONG&gt;202100923&lt;/STRONG&gt;&amp;nbsp;or&amp;nbsp;&lt;STRONG&gt;20210924&lt;/STRONG&gt;".&amp;nbsp; The problem here is what if your absolute.path values are not always 4 directories deep.&amp;nbsp; for example:&lt;BR /&gt;&lt;STRONG&gt;1. /user/Mahesh/test/202100923/subdir1&lt;BR /&gt;2. /user/Mahesh/test/20210924/subdir1&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;3.&amp;nbsp; /user/Mahesh/test/202100923/subdir1/subdir2&lt;BR /&gt;4. /user/Mahesh/test/20210924/subdir1/subdir2&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your expression would still return just&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;"&lt;STRONG&gt;202100923&lt;/STRONG&gt;&amp;nbsp;or&amp;nbsp;&lt;STRONG&gt;20210924&lt;/STRONG&gt;".&lt;BR /&gt;&lt;BR /&gt;I don't know how or where you are using this folder information later in your dataflow(s), so hard to give recommendations on what to do.&lt;BR /&gt;&lt;BR /&gt;But assuming new example i gave above, here are some other NEL options:&lt;BR /&gt;&lt;STRONG&gt;${absolute.path:substringAfterLast('/')}&lt;/STRONG&gt; would return:&lt;BR /&gt;1. subdir1&lt;BR /&gt;2. subdir1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. subdir2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4. subdir2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;${absolute.path:substringAfter('/user/Mahesh/test')}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1.&amp;nbsp; /202100923/subdir1&lt;BR /&gt;2.&amp;nbsp; /20210924/subdir1&lt;BR /&gt;3.&amp;nbsp; /202100923/subdir1/subdir2&lt;BR /&gt;4.&amp;nbsp; /20210924/subdir1/subdir2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you found this response assisted with your query, please take a moment to login and click on "&lt;STRONG&gt;Accept as Solution&lt;/STRONG&gt;" below this post.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 17:34:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-Nifi/m-p/325255#M229574</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2021-09-24T17:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Apache Nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-Nifi/m-p/325312#M229602</link>
      <description>&lt;P&gt;Hey Matt,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for you advise. I have followed the below approach and worked fine for my issue.&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;${absolute.path:getDelimitedField('5','/')}&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 06:52:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-Nifi/m-p/325312#M229602</guid>
      <dc:creator>Cloud_era</dc:creator>
      <dc:date>2021-09-26T06:52:55Z</dc:date>
    </item>
  </channel>
</rss>

