Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

On Nifi Is it possible using PutHdfs Processor to configure so that files are written to day wise folder ,rolling to new day folder everyday

avatar
Frequent Visitor

For Ex:

USing getKafka -to read the stream

PutHDFS to write to HDFS

Can it be configured in the processor to create new folders when a new day starts and write the kafka topic data to that folder.

Basically to maintain day wise folders in HDFS using putHDFS processor in nifi.

1 ACCEPTED SOLUTION

avatar
Master Guru

Hi @manisha jain, yep it is possible with PutHDFS processor.
in puthdfs processor keep directory property as

/user/kafka/${now():format("yyyy-MM-dd")}
Expression:-
${now():format("yyyy-MM-dd")}
above expression now will be the current timestamp and extracts only the date and creates the directory with the date dynamically and and stores all the flow files that are generated with same date will be stored into the same directory.

PutHDFS properties:-

38542-puthdfs-configs.png

View solution in original post

2 REPLIES 2

avatar
Master Guru

Hi @manisha jain, yep it is possible with PutHDFS processor.
in puthdfs processor keep directory property as

/user/kafka/${now():format("yyyy-MM-dd")}
Expression:-
${now():format("yyyy-MM-dd")}
above expression now will be the current timestamp and extracts only the date and creates the directory with the date dynamically and and stores all the flow files that are generated with same date will be stored into the same directory.

PutHDFS properties:-

38542-puthdfs-configs.png

avatar
Frequent Visitor

Thanks @Yash i have used the same approach,it works.