ListSFTP 2025.10.9.21

Bundle

org.apache.nifi | nifi-standard-nar

Description

Performs a listing of the files residing on an SFTP server. For each file that is found on the remote server, a new FlowFile will be created with the filename attribute set to the name of the file on the remote server. This can then be used in conjunction with FetchSFTP in order to fetch those files.

Tags

files, ingest, input, list, remote, sftp, source

Input Requirement

FORBIDDEN

Supports Sensitive Dynamic Properties

false

Properties

PropertyDescription
Algorithm NegotiationConfiguration strategy for SSH algorithm negotiation
Ciphers AllowedA comma-separated list of Ciphers allowed for SFTP connections. Leave unset to allow all. Available options are: 3des-cbc, aes128-cbc, aes128-ctr, aes128-gcm@openssh.com, aes192-cbc, aes192-ctr, aes256-cbc, aes256-ctr, aes256-gcm@openssh.com, arcfour128, arcfour256, blowfish-cbc, chacha20-poly1305@openssh.com, none
Connection TimeoutAmount of time to wait before timing out while creating a connection
Data TimeoutWhen transferring a file between the local and remote system, this value specifies how long is allowed to elapse without any data being transferred between systems
Entity Tracking Initial Listing TargetSpecify how initial listing should be handled. Used by ‘Tracking Entities’strategy.
Entity Tracking State CacheListed entities are stored in the specified cache storage so that this processor can resume listing across NiFi restart or in case of primary node change. ‘Tracking Entities’strategy require tracking information of all listed entities within the last ‘Tracking Time Window’. To support large number of entities, the strategy uses DistributedMapCache instead of managed state. Cache key format is ‘ListedEntities::{processorId}(::{nodeId})’. If it tracks per node listed entities, then the optional ‘::{nodeId}’ part is added to manage state separately. E.g. cluster wide cache key =’ListedEntities::8dda2321-0164-1000-50fa-3042fe7d6a7b’, per node cache key =’ListedEntities::8dda2321-0164-1000-50fa-3042fe7d6a7b::nifi-node3’ The stored cache content is Gzipped JSON string. The cache key will be deleted when target listing configuration is changed. Used by ‘Tracking Entities’strategy.
Entity Tracking Time WindowSpecify how long this processor should track already-listed entities. ‘Tracking Entities’strategy can pick any entity whose timestamp is inside the specified time window. For example, if set to ’30 minutes’, any entity having timestamp in recent 30 minutes will be the listing target when this processor runs. A listed entity is considered ‘new/updated’ and a FlowFile is emitted if one of following condition meets: 1. does not exist in the already-listed entities, 2. has newer timestamp than the cached entity, 3. has different size than the cached entity. If a cached entity ‘s timestamp becomes older than specified time window, that entity will be removed from the cached already-listed entities. Used by’Tracking Entities’strategy.
File Filter RegexProvides a Java Regular Expression for filtering Filenames; if a filter is supplied, only files whose names match that Regular Expression will be fetched
Follow Symbolic LinksIf true, will pull even symbolic files and also nested symbolic subdirectories; otherwise, will not read symbolic files and will not traverse symbolic link subdirectories
Host Key FileIf supplied, the given file will be used as the Host Key; otherwise, if ‘Strict Host Key Checking’ property is applied (set to true) then uses the ‘known_hosts’ and ‘known_hosts2’ files from ~/.ssh directory else no host key file will be used
HostnameThe fully qualified hostname or IP address of the remote system
Ignore Dotted FilesIf true, files whose names begin with a dot (“.”) will be ignored
Key Algorithms AllowedA comma-separated list of Key Algorithms allowed for SFTP connections. Leave unset to allow all. Available options are: ecdsa-sha2-nistp256, ecdsa-sha2-nistp256-cert-v01@openssh.com, ecdsa-sha2-nistp384, ecdsa-sha2-nistp384-cert-v01@openssh.com, ecdsa-sha2-nistp521, ecdsa-sha2-nistp521-cert-v01@openssh.com, rsa-sha2-256, rsa-sha2-256-cert-v01@openssh.com, rsa-sha2-512, rsa-sha2-512-cert-v01@openssh.com, sk-ecdsa-sha2-nistp256@openssh.com, sk-ssh-ed25519@openssh.com, ssh-dss, ssh-dss-cert-v01@openssh.com, ssh-ed25519, ssh-ed25519-cert-v01@openssh.com, ssh-rsa, ssh-rsa-cert-v01@openssh.com
Key Exchange Algorithms AllowedA comma-separated list of Key Exchange Algorithms allowed for SFTP connections. Leave unset to allow all. Available options are: curve25519-sha256, curve25519-sha256@libssh.org, curve448-sha512, diffie-hellman-group-exchange-sha1, diffie-hellman-group-exchange-sha256, diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, diffie-hellman-group14-sha256, diffie-hellman-group15-sha512, diffie-hellman-group16-sha512, diffie-hellman-group17-sha512, diffie-hellman-group18-sha512, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, mlkem1024nistp384-sha384, mlkem768nistp256-sha256, mlkem768x25519-sha256, sntrup761x25519-sha512, sntrup761x25519-sha512@openssh.com
Listing StrategySpecify how to determine new/updated entities. See each strategy descriptions for detail.
Maximum File AgeThe maximum age that a file must be in order to be pulled; any file older than this amount of time (according to last modification date) will be ignored
Maximum File SizeThe maximum size that a file can be in order to be pulled
Message Authentication Codes AllowedA comma-separated list of Message Authentication Codes allowed for SFTP connections. Leave unset to allow all. Available options are: hmac-md5, hmac-md5-96, hmac-sha1, hmac-sha1-96, hmac-sha1-etm@openssh.com, hmac-sha2-256, hmac-sha2-256-etm@openssh.com, hmac-sha2-512, hmac-sha2-512-etm@openssh.com
Minimum File AgeThe minimum age that a file must be in order to be pulled; any file younger than this amount of time (according to last modification date) will be ignored
Minimum File SizeThe minimum size that a file must be in order to be pulled
PasswordPassword for the user account
Path Filter RegexWhen Search Recursively is true, then only subdirectories whose path matches the given Regular Expression will be scanned
PortThe port that the remote system is listening on for file transfers
Private Key PassphrasePassword for the private key
Private Key PathThe fully qualified path to the Private Key file
Record WriterSpecifies the Record Writer to use for creating the listing. If not specified, one FlowFile will be created for each entity that is listed. If the Record Writer is specified, all entities will be written to a single FlowFile instead of adding attributes to individual FlowFiles.
Remote PathThe path on the remote system from which to pull or push files
Search RecursivelyIf true, will pull files from arbitrarily nested subdirectories; otherwise, will not traverse subdirectories
Send Keep Alive On TimeoutSend a Keep Alive message every 5 seconds up to 5 times for an overall timeout of 25 seconds.
Strict Host Key CheckingIndicates whether or not strict enforcement of hosts keys should be applied
Target System Timestamp PrecisionSpecify timestamp precision at the target system. Since this processor uses timestamp of entities to decide which should be listed, it is crucial to use the right timestamp precision.
Use CompressionIndicates whether or not ZLIB compression should be used when transferring files
UsernameUsername
proxy-configuration-serviceSpecifies the Proxy Configuration Controller Service to proxy network requests.

State management

ScopesDescription
CLUSTERAfter performing a listing of files, the timestamp of the newest file is stored. This allows the Processor to list only files that have been added or modified after this date the next time that the Processor is run. State is stored across the cluster so that this Processor can be run on Primary Node only and if a new Primary Node is selected, the new node will not duplicate the data that was listed by the previous Primary Node.

Relationships

NameDescription
successAll FlowFiles that are received are routed to success

Writes attributes

NameDescription
sftp.remote.hostThe hostname of the SFTP Server
sftp.remote.portThe port that was connected to on the SFTP Server
sftp.listing.userThe username of the user that performed the SFTP Listing
file.ownerThe numeric owner id of the source file
file.groupThe numeric group id of the source file
file.permissionsThe read/write/execute permissions of the source file
file.sizeThe number of bytes in the source file
file.lastModifiedTimeThe timestamp of when the file in the filesystem waslast modified as ‘yyyy-MM-dd’T’HH:mm:ssZ’
filenameThe name of the file on the SFTP Server
pathThe fully qualified name of the directory on the SFTP Server from which the file was pulled
mime.typeThe MIME Type that is provided by the configured Record Writer

See also