<?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 to get files two hours ago in FTP file system，thanks in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-get-files-two-hours-ago-in-FTP-file-system-thanks/m-p/334324#M231720</link>
    <description>&lt;P&gt;I know the ListSftp processor have '&lt;SPAN&gt;Minimum File Age' property, but the ListFtp have not&amp;nbsp; 'Minimum File Age' property, do you know how to add 'Minimum File Age' property&amp;nbsp; in ListFtp properssor. thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;when i add 'Minimum File Age' in ListFTP processor,&amp;nbsp; it not work, like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zhangliang_0-1642727244943.png" style="width: 810px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/33214i8ED8C4894C6DD150/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zhangliang_0-1642727244943.png" alt="zhangliang_0-1642727244943.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;it displays 'Minimum File Age' is not a supported property or has no Validator associated with it&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jan 2022 01:08:59 GMT</pubDate>
    <dc:creator>zhangliang</dc:creator>
    <dc:date>2022-01-21T01:08:59Z</dc:date>
    <item>
      <title>How to get files two hours ago in FTP file system，thanks</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-get-files-two-hours-ago-in-FTP-file-system-thanks/m-p/334282#M231698</link>
      <description>&lt;P&gt;how to use ListFTP and FetchFTP processors&amp;nbsp;get all files two hours before the current time in FTP server.&lt;/P&gt;&lt;P&gt;There will be more and more files in the FTP server named by date&lt;/P&gt;&lt;P&gt;These filename in the FTP contains a date as follows:&amp;nbsp;&lt;/P&gt;&lt;P&gt;xxxx-xxxx-xxxx-xxxx-20211231143000-xxxx-xxxx.csv&lt;/P&gt;&lt;P&gt;xxxx-xxxx-xxxx-xxxx-20211231153000-xxxx-xxxx.csv&lt;/P&gt;&lt;P&gt;......&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 12:35:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-get-files-two-hours-ago-in-FTP-file-system-thanks/m-p/334282#M231698</guid>
      <dc:creator>zhangliang</dc:creator>
      <dc:date>2022-01-20T12:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to get files two hours ago in FTP file system，thanks</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-get-files-two-hours-ago-in-FTP-file-system-thanks/m-p/334317#M231714</link>
      <description>&lt;P&gt;Have you considered looking at the ListFtp property:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="table-cell required"&gt;Minimum File Age and set it to 2 hours&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 18:58:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-get-files-two-hours-ago-in-FTP-file-system-thanks/m-p/334317#M231714</guid>
      <dc:creator>DigitalPlumber</dc:creator>
      <dc:date>2022-01-20T18:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get files two hours ago in FTP file system，thanks</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-get-files-two-hours-ago-in-FTP-file-system-thanks/m-p/334324#M231720</link>
      <description>&lt;P&gt;I know the ListSftp processor have '&lt;SPAN&gt;Minimum File Age' property, but the ListFtp have not&amp;nbsp; 'Minimum File Age' property, do you know how to add 'Minimum File Age' property&amp;nbsp; in ListFtp properssor. thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;when i add 'Minimum File Age' in ListFTP processor,&amp;nbsp; it not work, like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zhangliang_0-1642727244943.png" style="width: 810px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/33214i8ED8C4894C6DD150/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zhangliang_0-1642727244943.png" alt="zhangliang_0-1642727244943.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;it displays 'Minimum File Age' is not a supported property or has no Validator associated with it&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 01:08:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-get-files-two-hours-ago-in-FTP-file-system-thanks/m-p/334324#M231720</guid>
      <dc:creator>zhangliang</dc:creator>
      <dc:date>2022-01-21T01:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get files two hours ago in FTP file system，thanks</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-get-files-two-hours-ago-in-FTP-file-system-thanks/m-p/334393#M231745</link>
      <description>&lt;P&gt;Without knowing how the FTP directory is populated, you might have an issue with the ListFTP state and might consider changing its its Listing Strategy,&lt;/P&gt;&lt;P&gt;However assuming that is no issue and you want to only perform an action based on any file with a naming structure like this:&amp;nbsp;xxxx-xxxx-xxxx-xxxx-20220121110000-xxxx-xxxx.csv and only if it is older than two hours from "now"&lt;/P&gt;&lt;P&gt;I would run the output of your ListFTP to an UpdateAttribute and add these 2 properties:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;property name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;fileTime&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;value&lt;/P&gt;&lt;P&gt;${filename:getDelimitedField(5,'-'):trim():toDate('yyyyMMddHHmmss'):toNumber()}&lt;/P&gt;&lt;P&gt;property name&lt;/P&gt;&lt;P&gt;timeNow&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;value&lt;/P&gt;&lt;P&gt;${now():toNumber():minus(7200000)}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then route that to a RouteOnAttribute and add a new property:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;property name&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value&lt;/P&gt;&lt;P&gt;2 hours old&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ${fileTime:le(${timeNow})}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can drag that connection to follow on processing and the unmatched connection to other processing or terminate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Explanation:&lt;/P&gt;&lt;P&gt;filelName&lt;/P&gt;&lt;P&gt;${filename:getDelimitedField(5,'-'):trim():toDate('yyyyMMddHHmmss'):toNumber()}&lt;/P&gt;&lt;P&gt;This grabs the time out of your filename and converts it to a Date object so it can be converted to its epoch representation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;timeNow&lt;/P&gt;&lt;P&gt;${now():toNumber():minus(7200000)}&lt;/P&gt;&lt;P&gt;Sets a value 2 hours ago from current time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;${fileTime:le(${timeNow})}&lt;/P&gt;&lt;P&gt;If attribute fileName is less than or equal to timeNow it means that it is 2 hours old.&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, 21 Jan 2022 17:50:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-get-files-two-hours-ago-in-FTP-file-system-thanks/m-p/334393#M231745</guid>
      <dc:creator>DigitalPlumber</dc:creator>
      <dc:date>2022-01-21T17:50:18Z</dc:date>
    </item>
  </channel>
</rss>

