Support Questions

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

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

avatar
New Contributor
 
3 REPLIES 3

avatar

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.

avatar
Contributor

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

avatar
New Contributor

Thank you!