Skip to main content
ushasri
Silver ⭐️⭐️⭐️
April 18, 2023
Solved

Extract current time

Dears,

 

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

 

Thankyou!

cotopaul
cotopaulAnswer
Platinum ⭐️
April 18, 2023

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

1 reply

cotopaul
cotopaulAnswer
Platinum ⭐️
April 18, 2023

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

Translate