FetchFile 2.0.0

Bundle
org.apache.nifi | nifi-standard-nar
Description
Reads the contents of a file from disk and streams it into the contents of an incoming FlowFile. Once this is done, the file is optionally moved elsewhere or deleted to help keep the file system organized.
Tags
fetch, files, filesystem, get, ingest, ingress, input, local, source
Input Requirement
REQUIRED
Supports Sensitive Dynamic Properties
false
Properties
Restrictions
Required Permission Explanation
read filesystem Provides operator the ability to read from any file that NiFi has access to.
write filesystem Provides operator the ability to delete any file that NiFi has access to.
Relationships
Name Description
permission.denied Any FlowFile that could not be fetched from the file system due to the user running NiFi not having sufficient permissions will be transferred to this Relationship.
success Any FlowFile that is successfully fetched from the file system will be transferred to this Relationship.
failure Any FlowFile that could not be fetched from the file system for any reason other than insufficient permissions or the file not existing will be transferred to this Relationship.
not.found Any FlowFile that could not be fetched from the file system because the file could not be found will be transferred to this Relationship.
Use Cases Involving Other Components
  • Ingest all files from a directory into NiFi
    Description
    Ingest all files from a directory into NiFi
    Keywords
    local, files, filesystem, ingest, ingress, get, source, input, fetch
    Processor Configurations
    org.apache.nifi.processors.standard.ListFile
    Configure the "Input Directory" property to point to the directory that you want to ingest files from.
    Set the "Input Directory Location" property to "Local"
    Optionally, set "Minimum File Age" to a small value such as "1 min" to avoid ingesting files that are still being written to.
    
    Connect the 'success' Relationship to the FetchFile processor.
    
    org.apache.nifi.processors.standard.FetchFile
    Set the "File to Fetch" property to `${absolute.path}/${filename}`
    Set the "Completion Strategy" property to `None`
    
  • Ingest specific files from a directory into NiFi, filtering on filename
    Description
    Ingest specific files from a directory into NiFi, filtering on filename
    Keywords
    local, files, filesystem, ingest, ingress, get, source, input, fetch, filter
    Processor Configurations
    org.apache.nifi.processors.standard.ListFile
    Configure the "Input Directory" property to point to the directory that you want to ingest files from.
    Set the "Input Directory Location" property to "Local"
    Set the "File Filter" property to a Regular Expression that matches the filename (without path) of the files that you want to ingest. For example, to ingest all .jpg files, set the value to `.*\.jpg`
    Optionally, set "Minimum File Age" to a small value such as "1 min" to avoid ingesting files that are still being written to.
    
    Connect the 'success' Relationship to the FetchFile processor.
    
    org.apache.nifi.processors.standard.FetchFile
    Set the "File to Fetch" property to `${absolute.path}/${filename}`
    Set the "Completion Strategy" property to `None`
    
See Also