<?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: can we list flow files in nifi server by their duration in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/can-we-list-flow-files-in-nifi-server-by-their-duration/m-p/292755#M216294</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/76030"&gt;@NY&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anything you can do via the NiFi canvas, you can also accomplish via the rest-api.&lt;BR /&gt;&lt;BR /&gt;So you can create a queue listing via a rest-api call:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl http://&amp;lt;nifi-hostname&amp;gt;:&amp;lt;port&amp;gt;/nifi-api/flowfile-queues/&amp;lt;connection-uuid&amp;gt;/listing-requests&lt;/LI-CODE&gt;&lt;P&gt;The above call will return a response that includes the URL you need to use to retrieve those results.&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;http://&amp;lt;nifi-hostname&amp;gt;:&amp;lt;port&amp;gt;/nifi-api/flowfile-queues/&amp;lt;connection-uuid&amp;gt;/listing-requests/1d98d557-0171-1000-ffff-ffffd559ca47&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Then query for the listings results&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl http://&amp;lt;nifi-hostname&amp;gt;:&amp;lt;port&amp;gt;/nifi-api/flowfile-queues/&amp;lt;connection-uuid&amp;gt;/listing-requests/1d98d557-0171-1000-ffff-ffffd559ca47&lt;/LI-CODE&gt;&lt;P&gt;This return a json with all the FlowFiles from that specific connection queue from all nodes in your NiFi cluster.&amp;nbsp; That json would need to be parsed for info like nodes where the "lineageDuration" epoch time is x amount of time older then now, the "clusterNodeAddress" (which node holds the file), and maybe filename".&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;and then delete the queue listing when done. (this is important or it stays around using heap space).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -X DELETE http://&amp;lt;nifi-hostname&amp;gt;:&amp;lt;port&amp;gt;/nifi-api/flowfile-queues/&amp;lt;connection-uuid&amp;gt;/listing-requests/1d98d557-0171-1000-ffff-ffffd559ca47&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Matt&lt;/P&gt;</description>
    <pubDate>Fri, 27 Mar 2020 20:20:16 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2020-03-27T20:20:16Z</dc:date>
  </channel>
</rss>

