Support Questions

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

about getsftp processor's attributes

avatar
Explorer

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?

1 ACCEPTED SOLUTION

avatar
Master Guru
@john y

We can directly access filesize with

${fileSize} 

and this attribute expression will result the actual filesize value of flowfile.

View solution in original post

3 REPLIES 3

avatar
Master Guru
@john y

We can directly access filesize with

${fileSize} 

and this attribute expression will result the actual filesize value of flowfile.

avatar
Explorer

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?

avatar
Super Mentor

@john y

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