Support Questions

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

Converting timestamp in NIFI

avatar
Explorer

I need to convert timestamp value coming in flowfile of  cst/cdt  time or anytime to UTC in nifi . But I am unable to convert it is not working. Can anybody help on this

2 REPLIES 2

avatar

avatar

@sarithe,


What is the format of the record you are trying to convert? What is the data type of the field you are trying to convert? Are you trying to modify the value of a record or the value of an attribute?

If you are trying to update the values from within each record, you should try using an UpdateRecord processor, in which you define a Record Writer and a Record Reader. Next, you can add another property in your processor and define it like:
Property: /your_column --> pay attention to the slash in front as it is very important.

Value: ${field.value:multiply(1000):toNumber():toDate("yyyyMMdd", "GMT"):format("yyyyMMdd")} --> this is just an example, as I do not know how your data looks like and how you want it displayed. You can use NiFi's EL to define the exact format you required, but make sure you use field.value if you want to modify the value from within that specific column.