Support Questions

Find answers, ask questions, and share your expertise

Extracting .rar file in NIFI

New Contributor

 I am getting .zip files as well as .rar files from my source location. While i am able to unzip the .zip files using unpack content processor , i am not able to extract the .rar files. I even tried compress component processor but seems that too doesn't support .rar files.  How should i extract the .rar files ?  install winrar in root folder and then call it using execute stream processor ? 


Rising Star

UnpackContent processor do not support .rar file:


Hence, yes you can use an ExecuteStreamCommand processor to invoke WinRAR command-line tool.


I realize this topic is a bit old, but I have this same problem to solve. I am struggling with setting the unrar in the ExecuteStreamCommand process, then having the decompressed files returned in the output on the stream for additional processing. I am getting broken pipe errors and unrar cmd ended in nonzero errors. How exactly do I set this up so that it works just like Nifi's native UnpackContent process? Thank you.


Super Mentor

Always best tot start a new question rather than commenting on an old post.  Will get you better traction that way from the community.

The reason NiFi does not have native processor that can handle rar files is because there does not appear to be java native libraries available to do this.


You may consider filtering and writing your rar files to a flow specific directory on disk and then use the ExecuteStreamCommand processor to unpack that rar in that directory.  You could have a new flow that uses the listFile (configured to ignore files with rar extension) and FetchFile processor to monitor that directory for new files and consume them for further processing.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,