Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

NiFi: Routing on File Types, e.g. csv, tsv, xlsx


I have a connected SFTP server, and I am trying to route files based on type: `.csv`, `.tsv`, and `.xlsx`. For now, I'm just uploading test files through the command line.

My flow is:

GetSFTP (with correct hostname, etc.) ->

RouteOnAttribute ->

LogAttribute (will dump elsewhere soon, this is just for testing)

My problem, I think, is that I created a property in `RouteOnAttribute` incorrectly:


Am I correct in assuming that this does not actually pick up on the `.csv` because it is not technically part of the filename? What would be the correct expression to route on the file type? Thanks!


Super Mentor

@Robert Papel

I would suggest running your GetSFTP processor while leaving the RouteOnAttribute processor stopped log enough to get a some FlowFiles queued in the connection between those processors.

Then right click on that queued connection and select "list queue" from menu that appears.

From the list queue UI select a few different FlowFiles and look at the values assigned to the various attributes. Does filename show as being "<some value>.csv" or just "<some value>"?

If filename does not include extension, perhaps try using the IdentifyMimeType processor to see if it properly sets a "mime.type" attribute on each FlowFile which could then be used by your RouteOnAttribute processor.


Thank you,



If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.