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.

Is it possible in NiFi to check an input file for correct checksum with its md5 file before loading and processing it to workflow?

Is it possible in NiFi to check an input file for correct checksum with its md5 file before loading and processing it to workflow?

New Contributor
 
3 REPLIES 3
Highlighted

Re: Is it possible in NiFi to check an input file for correct checksum with its md5 file before loading and processing it to workflow?

You can achieve this by using the HashContent processor or the ExecuteStreamCommand processor to calculate the MD5 hash of the content and compare it to the contents of the prepared *.md5 digest file, which you can read with GetFile and then ExtractText/RouteOnContent/RouteText to compare the MD5 value in a flowfile attribute with the contents of the file.

Highlighted

Re: Is it possible in NiFi to check an input file for correct checksum with its md5 file before loading and processing it to workflow?

Explorer

Here's a working example using separate signature files in the filesystem (e.g. 'filename.tgz' is the file and 'filename.sig' is a file containing the hash), and storing these in a distributed map cache.

verify-sha256-hash.xml

Highlighted

Re: Is it possible in NiFi to check an input file for correct checksum with its md5 file before loading and processing it to workflow?

New Contributor

Thank you!

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