Hi all.
Just playing around with NiFi to evaluate it.
I'm trying to read files from the same directory and route them to the appropriate section using a FetchFile processor.
Everything is fine when I change ${filename} attribute with the exact file name but I can't filter files evaluating their name.
I can't figure out how to fetch only files starting with two characters (eg. 10,11,12,13)
Any attempt bring me to an error or to an output filename named true
My NiFi Flow:
ListFile -> FetchFile -> PutHDFS
Thanks
Created 12-23-2019 09:29 AM
Sounds like you should be using a RouteOnAttribute processor between your listFile and FetchFile processor so that only those FlowFIles you want to Fetch the content for are routed to the FetchFile processor.
The listFile processor produces one FlowFile for each file that is returned during the listing execution. The listFile processor writes a number of FlowFile attributes to the FlowFiles that are produced.
The Filename attribute is what you will want to use when writing your NiFi Expression Language (EL) statement for your dynamically created properties added to the RouteOnAttribute processor.
You can find a EL guide under "Help" under the NiFi global menu in the upper right corner of the NiFi UI.
Hope this helps,
Matt
Created on 11-28-2022 10:55 PM - edited 11-28-2022 10:57 PM
hello, I want to make the files that I will read according to the name coming from another output, were you able to do this?
Created 12-05-2022 08:46 AM
@cihankara I recommend starting a new community question as this sounds like a different use case from this community post. Providing details of yoru use case like what is other output, how are those being ingested in to NiFi, what info is available in that output, etc..
Feel free to @MattWho in that new community post to trigger notification to me in the community.
Thanks,
Matt