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]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Extract current time

avatar
Explorer

Dears,

 

   How can I extract current time in Nifi and load into a column of a table in database

 

Thankyou!

1 ACCEPTED SOLUTION

avatar

hi @ushasri,

Can you provide some more details about your flow? Without knowing what you are doing in your flow, I can only tell you that you can use the Expression Language from NiFi and extract the current time send it into your stream. The current time can be called as an example like:

${now():toNumber():format('yyyy-MM-dd')} 

Next, you can use an UpdateRecord Processor, add the attribute to your newly defined column and send it to further processing.
More about NiFi's Expression Language: https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html

View solution in original post

1 REPLY 1

avatar

hi @ushasri,

Can you provide some more details about your flow? Without knowing what you are doing in your flow, I can only tell you that you can use the Expression Language from NiFi and extract the current time send it into your stream. The current time can be called as an example like:

${now():toNumber():format('yyyy-MM-dd')} 

Next, you can use an UpdateRecord Processor, add the attribute to your newly defined column and send it to further processing.
More about NiFi's Expression Language: https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html