<?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: API Incremental load in NiFi using end_time in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/API-Incremental-load-in-NiFi-using-end-time/m-p/285234#M211698</link>
    <description>&lt;P&gt;Thanks for the detailed explanation. This helps!&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2019 09:19:43 GMT</pubDate>
    <dc:creator>rki</dc:creator>
    <dc:date>2019-12-10T09:19:43Z</dc:date>
    <item>
      <title>API Incremental load in NiFi using end_time</title>
      <link>https://community.cloudera.com/t5/Support-Questions/API-Incremental-load-in-NiFi-using-end-time/m-p/284416#M211198</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to do an incremental load from API using the API end_time tag.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Trying to use the below syntax in RouteAttribute processor to fetch only records updated till yesterday night - 23:59:59&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you tell me what is the exact syntax for checking end_time here?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;${end_time:lt(${now():toNumber():minus(86400000) })}&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 10:20:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/API-Incremental-load-in-NiFi-using-end-time/m-p/284416#M211198</guid>
      <dc:creator>rki</dc:creator>
      <dc:date>2019-11-29T10:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: API Incremental load in NiFi using end_time</title>
      <link>https://community.cloudera.com/t5/Support-Questions/API-Incremental-load-in-NiFi-using-end-time/m-p/284905#M211507</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/71807"&gt;@rki&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your NiFi Expression Language (EL) statement shared expects that the inbound FlowFile already has FlowFile attribute named "&lt;SPAN&gt;end_time" with some value assigned to it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What does that value look like?&amp;nbsp; How was it created?&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;${end_time:lt(${now():toNumber():minus(86400000)})}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Let's break down the embedded NiFi EL statement first:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;${now():toNumber():minus(86400000)}&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;The &lt;STRONG&gt;now()&lt;/STRONG&gt; function returns the current timestamp.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The &lt;STRONG&gt;toNumber()&lt;/STRONG&gt; function converts that timestamp in to milliseconds since midnight GMT Jan 1, 1970.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The &lt;STRONG&gt;minus()&lt;/STRONG&gt; function subtracts the number passed to the function (86400000) from the above calculated milliseconds.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Assuming that the "&lt;STRONG&gt;end_time&lt;/STRONG&gt;" attribute returns some number that represents the number of milliseconds since&amp;nbsp;midnight GMT Jan 1, 1970 also and that number is less than the value calculated by the embedded NiFi EL, the NiFi EL will return "true".&amp;nbsp; Essential all files were the end_time is older then 24 hours from the current timestamp.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The FlowFile would then get routed to the relationship named by your RouteOnAttribute custom property.&lt;BR /&gt;If false is returned and no other custom properties match, the FlowFile would be routed to unmatched.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you are really trying to only route FlowFiles were the "&lt;STRONG&gt;end_time&lt;/STRONG&gt;" milliseconds falls within the last 24 hours only, then you would want to use the &lt;STRONG&gt;ge()&lt;/STRONG&gt; function instead of the &lt;STRONG&gt;lt()&lt;/STRONG&gt; function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 18:35:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/API-Incremental-load-in-NiFi-using-end-time/m-p/284905#M211507</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2019-12-05T18:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: API Incremental load in NiFi using end_time</title>
      <link>https://community.cloudera.com/t5/Support-Questions/API-Incremental-load-in-NiFi-using-end-time/m-p/285234#M211698</link>
      <description>&lt;P&gt;Thanks for the detailed explanation. This helps!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 09:19:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/API-Incremental-load-in-NiFi-using-end-time/m-p/285234#M211698</guid>
      <dc:creator>rki</dc:creator>
      <dc:date>2019-12-10T09:19:43Z</dc:date>
    </item>
  </channel>
</rss>

