Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

CAN NIFI TRANSFORM A COMPLEX TIMESTAMP ?

Solved Go to solution

CAN NIFI TRANSFORM A COMPLEX TIMESTAMP ?

Contributor

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

Accepted Solutions
Highlighted

Re: CAN NIFI TRANSFORM A COMPLEX TIMESTAMP ?

Contributor

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
Highlighted

Re: CAN NIFI TRANSFORM A COMPLEX TIMESTAMP ?

Explorer

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"

Highlighted

Re: CAN NIFI TRANSFORM A COMPLEX TIMESTAMP ?

Contributor

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

Don't have an account?
Coming from Hortonworks? Activate your account here