- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
how to filter file based on size file..??
- Labels:
-
Apache NiFi
Created ‎06-02-2017 03:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need help.. actually I am recently using nifi. I have realtime files that always created every minutes, but I just want put 4 MB of every file and I wont put file with lower size.. best regard to your response.. I using filter like ${fileSize:minus(4000000)} to filter 4 MB file, but It's doesn't work,.. I using listSFTP >> RouteOnAtribute >> FetchSFTP >> putFile..
Created on ‎06-05-2017 01:03 PM - edited ‎08-17-2019 11:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I understand your question, you want to route files larger than 4MB down a different path from the files smaller than 4MB.
In the RouteOnAttribute processor, add a property like:
Files greater than 4MB will be routed out the gt4mb realtionship and the files that are smaller than 4MB will go out the unmatched relationship.
Created ‎06-08-2017 08:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @rian amrodin
As @Wynner suggested, you should be able to route FlowFiles based on file size using 'gt()' EL function. However surprisingly, ListFTP and ListSFTP doesn't write 'file.size' attribute where it's supposed to do.. I submitted a JIRA NIFI-4041 and a fix for that. I hope it will be merged and available soon. Thanks for sharing your experience with Apache NiFi!
