Created 01-22-2019 09:14 PM
hello all,
I need to pull files from linux server, so at first i used listFile and fetchFile processors.
The files are being writing and when they are done, nifi need to pull them.
Unfotunatly, listFile timestamp already list the file but fetchFile did not pull them because they are still being writing (i added
last modified limitation). so the files left in the server.
To solve this problem, i started using getSftp which is really good, but it does not include file size attribute.
I can see the file size at DETAILS tab in the flowFile but cant access it.
Do you have any suggestion?
Created 01-23-2019 01:52 AM
We can directly access filesize with
${fileSize}
and this attribute expression will result the actual filesize value of flowfile.
Created 01-23-2019 01:52 AM
We can directly access filesize with
${fileSize}
and this attribute expression will result the actual filesize value of flowfile.
Created 01-23-2019 06:25 AM
Oh that worked. Thank you!
I thought that only writes attributes which apear in the processor documentation are accessable. How can i find each processor accessable attributes?
Created 01-23-2019 03:06 PM
There are a core set of attributes that will exist on all FlowFiles:
1. entryDate
2. lineageStartDate
3. fileSize
4. uuid
5. filename
6. path
-
The first four cannot be changed by users.
filename and path can have their values edited by users via something like UpdateAttribute processor.
-
You can insert a logAttribute processor anywhere in your flow to output the key/value attribute map for FlowFiles that pass through it to the nifi-app.log. Just keep in mind that leaving this processor in your flow will result in potentially a lot of log output.
-
Thanks,
Matt