<?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 list of files from FetchSFTP or any other way as ListSFTP does not take incoming flowfiles in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-get-list-of-files-from-FetchSFTP-or-any-other-way-as/m-p/375609#M242541</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="scoutjohn_0-1692968150270.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/38304i48D924151CD39106/image-size/medium?v=v2&amp;amp;px=400" role="button" title="scoutjohn_0-1692968150270.png" alt="scoutjohn_0-1692968150270.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this flowfile would be split and send to fetch sftp. Files are picked from there and then deleted after processing&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Aug 2023 12:59:25 GMT</pubDate>
    <dc:creator>scoutjohn</dc:creator>
    <dc:date>2023-08-25T12:59:25Z</dc:date>
    <item>
      <title>How to get list of files from FetchSFTP or any other way as ListSFTP does not take incoming flowfiles</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-get-list-of-files-from-FetchSFTP-or-any-other-way-as/m-p/375515#M242491</link>
      <description>&lt;P&gt;Hi , I am trying to List the files in an SFTP location. Cannot use ListSFTP because listSFTP does not take incoming connection, but the issue for us is the SFTP location is coming from a response of an API. Currently I am using&amp;nbsp;FetchSFTP. but takes only a single input which is a filename, that is incorrect as per the requirements, i need a list of files in a directory.&lt;BR /&gt;&lt;BR /&gt;I came across this ticket&amp;nbsp;&lt;A href="https://issues.apache.org/jira/browse/NIFI-4621" target="_blank" rel="noopener"&gt;[NIFI-4621] Allow inputs to ListSFTP and ListFTP - ASF JIRA (apache.org)&lt;/A&gt;&amp;nbsp;which is still in open state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any alternate way to achieve this? Is there a way to use executeScript and run python sftp ?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 14:24:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-get-list-of-files-from-FetchSFTP-or-any-other-way-as/m-p/375515#M242491</guid>
      <dc:creator>scoutjohn</dc:creator>
      <dc:date>2023-08-23T14:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get list of files from FetchSFTP or any other way as ListSFTP does not take incoming flowfiles</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-get-list-of-files-from-FetchSFTP-or-any-other-way-as/m-p/375573#M242521</link>
      <description>&lt;P&gt;I think I can achieve this by using &lt;SPAN&gt;ExecuteStreamCommand&lt;/SPAN&gt; processor and calling a script.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#!/bin/bash&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;HOST="host"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;USER="testuser"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;REMOTE_DIR="/files/data"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;export PASSWORD="Qwerty@123"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;BATCH_FILE=$(mktemp)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;echo "spawn sftp $USER@$HOST" &amp;gt; $BATCH_FILE&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;echo "expect \"password:\"" &amp;gt;&amp;gt; $BATCH_FILE&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;echo "send \"\$env(PASSWORD)\\r\"" &amp;gt;&amp;gt; $BATCH_FILE&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;echo "expect \"sftp&amp;gt;\"" &amp;gt;&amp;gt; $BATCH_FILE&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;echo "send \"ls -l $REMOTE_DIR\\r\"" &amp;gt;&amp;gt; $BATCH_FILE&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;echo "expect \"sftp&amp;gt;\"" &amp;gt;&amp;gt; $BATCH_FILE&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;echo "send \"exit\\r\"" &amp;gt;&amp;gt; $BATCH_FILE&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;expect $BATCH_FILE | sed -n '/sftp&amp;gt;/, /sftp&amp;gt;/p' | grep -v '^sftp&amp;gt;'| awk '$5 &amp;lt; 1000000000 {print $NF}'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;rm $BATCH_FILE&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;this will give &lt;STRONG&gt;output&lt;/STRONG&gt;:&amp;nbsp;&lt;BR /&gt;$ ./batchfile.sh&lt;BR /&gt;names.txt&lt;BR /&gt;names2.txt&lt;BR /&gt;numlist.txt&lt;BR /&gt;some_witherror.txt&lt;BR /&gt;&lt;BR /&gt;maybe increase the size of the attribute length to include larger value. Of course, for this I will have to install expect in my docker image.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 13:34:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-get-list-of-files-from-FetchSFTP-or-any-other-way-as/m-p/375573#M242521</guid>
      <dc:creator>scoutjohn</dc:creator>
      <dc:date>2023-08-24T13:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get list of files from FetchSFTP or any other way as ListSFTP does not take incoming flowfiles</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-get-list-of-files-from-FetchSFTP-or-any-other-way-as/m-p/375609#M242541</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="scoutjohn_0-1692968150270.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/38304i48D924151CD39106/image-size/medium?v=v2&amp;amp;px=400" role="button" title="scoutjohn_0-1692968150270.png" alt="scoutjohn_0-1692968150270.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this flowfile would be split and send to fetch sftp. Files are picked from there and then deleted after processing&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 12:59:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-get-list-of-files-from-FetchSFTP-or-any-other-way-as/m-p/375609#M242541</guid>
      <dc:creator>scoutjohn</dc:creator>
      <dc:date>2023-08-25T12:59:25Z</dc:date>
    </item>
  </channel>
</rss>

