Support Questions

Find answers, ask questions, and share your expertise

ExecuteStreamCommand to call 'unzip -l'

avatar
New Contributor

Is it possible to use ExecuteStreamCommand process to run 'unzip -l xxxx.zip' on an zip file that is in the flow and then return the zip's file list into an attribute?  If so how do I set it up not using a shell script?

3 REPLIES 3

avatar
Community Manager

@code_mnkey Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our NiFi experts @MattWho @cotopaul  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar

@code_mnkey, what you are trying to achieve is not directly doable with a single command. You would need to build a script which will execute your unzip command, list all the files which have been extracted, create an attribute in your new flowfile and send it down the stream into further processing. The language in which you build the script is mostly up to you, as long as you have everything installed on your NiFi machine.

Another way, besides ExecuteStreamCommand, is to use ExecuteScript and build a script integrated with the NiFi's logic. A very good example of how you can achieve most of your expected actions can be found here: https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-1/ta-p/248922

Make sure that you read all three parts to fully understand how to generate flowfile, compose attributes and send newly generated flowfiles down the stream.

avatar
Community Manager

@code_mnkey Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.  Thanks.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: