ListSFTP

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:

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

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, whether a property supports the NiFi Expression Language, and whether a property is considered "sensitive", meaning that its value will be encrypted. Before entering a value in a sensitive property, ensure that the nifi.properties file has an entry for the property nifi.sensitive.props.key.

NameDefault ValueAllowable ValuesDescription
Listing Strategytimestamps
  • Tracking Timestamps This strategy tracks the latest timestamp of listed entity to determine new/updated entities. Since it only tracks few timestamps, it can manage listing state efficiently. However, any newly added, or updated entity having timestamp older than the tracked latest timestamp can not be picked by this strategy. For example, such situation can happen in a file system if a file with old timestamp is copied or moved into the target directory without its last modified timestamp being updated.
  • Tracking Entities This strategy tracks information of all the listed entities within the latest 'Entity Tracking Time Window' to determine new/updated entities. This strategy can pick entities having old timestamp that can be missed with 'Tracing Timestamps'. However additional DistributedMapCache controller service is required and more JVM heap memory is used. See the description of 'Entity Tracking Time Window' property for further details on how it works.
Specify how to determine new/updated entities. See each strategy descriptions for detail.
HostnameThe fully qualified hostname or IP address of the remote system
Supports Expression Language: true (will be evaluated using variable registry only)
Port22The port to connect to on the remote host to fetch the data from
Supports Expression Language: true (will be evaluated using variable registry only)
UsernameUsername
Supports Expression Language: true (will be evaluated using variable registry only)
PasswordPassword for the user account
Sensitive Property: true
Supports Expression Language: true (will be evaluated using variable registry only)
Private Key PathThe fully qualified path to the Private Key file
Supports Expression Language: true (will be evaluated using variable registry only)
Private Key PassphrasePassword for the private key
Sensitive Property: true
Supports Expression Language: true (will be evaluated using variable registry only)
Remote Path.The path on the remote system from which to pull or push files
Supports Expression Language: true (will be evaluated using variable registry only)
Distributed Cache ServiceController Service API:
DistributedMapCacheClient
Implementations: DistributedMapCacheClientService
RedisDistributedMapCacheClientService
CouchbaseMapCacheClient
HBase_1_1_2_ClientMapCacheService
NOTE: This property is used merely for migration from old NiFi version before state management was introduced at version 0.5.0. The stored value in the cache service will be migrated into the state when this processor is started at the first time. The specified Controller Service was used to maintain state about what had been pulled from the remote server so that if a new node begins pulling data, it won't duplicate all of the work that has been done. If not specified, the information was not shared across the cluster. This property did not need to be set for standalone instances of NiFi but was supposed to be configured if NiFi had been running within a cluster.
Search Recursivelyfalse
  • true
  • false
If true, will pull files from arbitrarily nested subdirectories; otherwise, will not traverse subdirectories
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
Path Filter RegexWhen Search Recursively is true, then only subdirectories whose path matches the given Regular Expression will be scanned
Ignore Dotted Filestrue
  • true
  • false
If true, files whose names begin with a dot (".") will be ignored
Strict Host Key Checkingfalse
  • true
  • false
Indicates whether or not strict enforcement of hosts keys should be applied
Host Key FileIf supplied, the given file will be used as the Host Key; otherwise, no use host key file will be used
Connection Timeout30 secAmount of time to wait before timing out while creating a connection
Data Timeout30 secWhen 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
Send Keep Alive On Timeouttrue
  • true
  • false
Indicates whether or not to send a single Keep Alive message when SSH socket times out
Target System Timestamp Precisionauto-detect
  • Auto Detect Automatically detect time unit deterministically based on candidate entries timestamp. Please note that this option may take longer to list entities unnecessarily, if none of entries has a precise precision timestamp. E.g. even if a target system supports millis, if all entries only have timestamps without millis, such as '2017-06-16 09:06:34.000', then its precision is determined as 'seconds'.
  • Milliseconds This option provides the minimum latency for an entry from being available to being listed if target system supports millis, if not, use other options.
  • Seconds For a target system that does not have millis precision, but has in seconds.
  • Minutes For a target system that only supports precision in minutes.
Specify 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.
Proxy Configuration ServiceController Service API:
ProxyConfigurationService
Implementation: StandardProxyConfigurationService
Specifies the Proxy Configuration Controller Service to proxy network requests. If set, it supersedes proxy settings configured per component. Supported proxies: SOCKS + AuthN, HTTP + AuthN
Proxy TypeDIRECT
  • DIRECT
  • HTTP
  • SOCKS
Proxy type used for file transfers
Proxy HostThe fully qualified hostname or IP address of the proxy server
Supports Expression Language: true (will be evaluated using variable registry only)
Proxy PortThe port of the proxy server
Supports Expression Language: true (will be evaluated using variable registry only)
Http Proxy UsernameHttp Proxy Username
Supports Expression Language: true (will be evaluated using variable registry only)
Http Proxy PasswordHttp Proxy Password
Sensitive Property: true
Supports Expression Language: true (will be evaluated using variable registry only)
Entity Tracking State CacheController Service API:
DistributedMapCacheClient
Implementations: DistributedMapCacheClientService
RedisDistributedMapCacheClientService
CouchbaseMapCacheClient
HBase_1_1_2_ClientMapCacheService
Listed 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 Window3 hoursSpecify 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.
Supports Expression Language: true (will be evaluated using variable registry only)
Entity Tracking Initial Listing Targetall
  • Tracking Time Window Ignore entities having timestamp older than the specified 'Tracking Time Window' at the initial listing activity.
  • All Available Regardless of entities timestamp, all existing entities will be listed at the initial listing activity.
Specify how initial listing should be handled. Used by 'Tracking Entities' strategy.

Relationships:

NameDescription
successAll FlowFiles that are received are routed to success

Reads Attributes:

None specified.

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

State management:

ScopeDescription
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.

Restricted:

This component is not restricted.

Input requirement:

This component does not allow an incoming relationship.

System Resource Considerations:

None specified.

See Also:

FetchSFTP, GetSFTP, PutSFTP