<?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: Move entire folder based on date to S3 in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Move-entire-folder-based-on-date-to-S3/m-p/291880#M215768</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt; : Appreciate your inputs as well&lt;/P&gt;</description>
    <pubDate>Mon, 16 Mar 2020 19:31:12 GMT</pubDate>
    <dc:creator>Gubbi</dc:creator>
    <dc:date>2020-03-16T19:31:12Z</dc:date>
    <item>
      <title>Move entire folder based on date to S3</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Move-entire-folder-based-on-date-to-S3/m-p/291729#M215686</link>
      <description>&lt;P&gt;Used case :&amp;nbsp; Need to transfer entire folder of files based on date to S3.&lt;/P&gt;
&lt;P&gt;Ex :&amp;nbsp; Source Path (Linux) : /users/abc/&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;20200312&lt;/STRONG&gt;&lt;/FONT&gt;/gtry/gyyy.csv&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;S3&amp;nbsp; &amp;nbsp; : /Users/datastore/20200312/gyyy.csv&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since dates keep changing everyday, and i need to build dataflow which would pick files from date folder&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 02:38:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Move-entire-folder-based-on-date-to-S3/m-p/291729#M215686</guid>
      <dc:creator>Gubbi</dc:creator>
      <dc:date>2020-03-15T02:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Move entire folder based on date to S3</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Move-entire-folder-based-on-date-to-S3/m-p/291879#M215767</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/55311"&gt;@Shu_ashu&lt;/a&gt;&amp;nbsp; : I saw you had suggested similar pattern solution before. Could you please look into this and suggest approach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/t5/Support-Questions/NiFi-Creating-the-output-directory-from-the-content-of-the/td-p/231335" target="_blank"&gt;https://community.cloudera.com/t5/Support-Questions/NiFi-Creating-the-output-directory-from-the-content-of-the/td-p/231335&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 19:27:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Move-entire-folder-based-on-date-to-S3/m-p/291879#M215767</guid>
      <dc:creator>Gubbi</dc:creator>
      <dc:date>2020-03-16T19:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Move entire folder based on date to S3</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Move-entire-folder-based-on-date-to-S3/m-p/291880#M215768</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt; : Appreciate your inputs as well&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 19:31:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Move-entire-folder-based-on-date-to-S3/m-p/291880#M215768</guid>
      <dc:creator>Gubbi</dc:creator>
      <dc:date>2020-03-16T19:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Move entire folder based on date to S3</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Move-entire-folder-based-on-date-to-S3/m-p/291916#M215772</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/74756"&gt;@Gubbi&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Depending on which processor is being used to create your FlowFile from you source linux directory, you will likely have an "absolute.path" FlowFile attribute created on the FlowFile.&lt;BR /&gt;&lt;BR /&gt;absolute.path =&amp;nbsp;&lt;SPAN&gt;/users/abc/&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;20200312&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;/gtry/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can pass that FlowFile to an UpdateAttribute processor which can use NiFi Expression Language (EL) to extract the date from that absolute path in to a new FlowFile attribute&lt;BR /&gt;&lt;BR /&gt;Add new property (property name becomes new FlowFile attribute):&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Property:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Value:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;pathDate&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;${absolute.path:getDelimitedField('4','/')}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The resulting FlowFile will have a new attribute:&lt;BR /&gt;pathDate =&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;20200312&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Now you can use that FlowFile attribute later when writing to your target directory in S3.&lt;BR /&gt;&lt;BR /&gt;I assume you would use the putS3Object processor for this?&lt;BR /&gt;If so, you can configure the "Object Key" property with the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/Users/datastore/${pathDate}/${filename}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NiFi EL will replace ${pathDate} with "20200312" and ${filename} will be replaced with "gyyy.csv".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2020 00:09:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Move-entire-folder-based-on-date-to-S3/m-p/291916#M215772</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2020-03-17T00:09:49Z</dc:date>
    </item>
  </channel>
</rss>

