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.

How to convert unix timestamp to datetime in Apache NiFi?

Highlighted

Re: How to convert unix timestamp to datetime in Apache NiFi?

New Contributor

@Davide Isoardi where and how can I set these values (in this case user and datetime) to be able to transform them?

Re: How to convert unix timestamp to datetime in Apache NiFi?

Rising Star

in your place I would have:

  • convert record to JSON not to CSV
  • use EvaluateJsonPath to set the attribute from the JSON in the contentFile
  • use updateAttribute to transform datetime and user
  • use ReplaceText to replace all contentFile with the altered attribute
  • write the contentFile to FS

Re: How to convert unix timestamp to datetime in Apache NiFi?

Rising Star

in your place I would have:

  • convert record to JSON not to CSV
  • use EvaluateJsonPath to set the attribute from the JSON in the contentFile
  • use updateAttribute to transform datetime and user
  • use ReplaceText to replace all contentFile with the altered attribute
  • write the contentFile to FS

Re: How to convert unix timestamp to datetime in Apache NiFi?

New Contributor

The input file is in the text/html format, and the output file must be in csv format, because it will feed the database.

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