I have created a RouteOnAttribute processor in nifi dataflow, i want it to select only certain files to parse on. in the properties i have created a property "filetofetch" with following expression
${filename:contains('INCOMING.D151221')
I need to fetch the file name INCOMING.D< YYYYMMDD> so today 21 MARTS 2017 the filename would be
INCOMING.D20170321
I have tried with something like this to extraxt file name
${filename:contains('INCOMING.D'+ ${now():format('yyyymmdd')} )}
But i cannot concat with the date prefix any suggestions ?
Havmaage,
You can concat by use append in Expression language like below.,
You have to use the updateAttribute to store the 'Incoming.D' in one attribute name like below.
fileStartsWith:Incoming.D
Date:${now():format('yyyyMMdd')
Then finally use routeonattribute to check like below.
${filename:contains(${fileStartsWith:append(${date})})}
You cann't be concat with '+' in Nifi.
EDIT-1:
Date:${now():format('yyyyMMdd')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With