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.

CAN NIFI TRANSFORM A COMPLEX TIMESTAMP ?

avatar

Hi everyone,

I'm trying to change this kind of timestamp: "2016-07-06T15:04:33.332+00:00" to this "2016/07/06" with apache Nifi,

i have tried many things but failed miserably.

This is my configuration of the ReplaceText processor

Search Value = ${dbbf.timestamp_da}

Replacement Value = ${bddf.timestamp_da:toDate("yyyy-MM-dd'T'HH:mm:ss.SSSZ"):format('yyyy/MM/dd')}

Character Set = UTF-8 Maximum

Buffer Size = 1 MB

Replacement Strategy = Literal

Replace Evaluation Mode = Entire text

If Anyone can help i would really appreciate, Thanks in advance 🙂

1 ACCEPTED SOLUTION

avatar

I appreciate the help and thank you for that. I have found the format of the timestamp which is "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" it was a lot easier after that.

View solution in original post

2 REPLIES 2

avatar
Contributor

One idea is to try an executeprocess and pass the raw date into a shell command like this:

echo "2016-07-06T15:04:33.332+00:00" | awk -F"T" '{print $1}' | sed 's/-/\//g'

produces the format "2016/07/06"

avatar

I appreciate the help and thank you for that. I have found the format of the timestamp which is "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" it was a lot easier after that.