Created 08-30-2023 11:44 AM
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?
Created 08-30-2023 12:42 PM
@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,Created 08-31-2023 08:02 AM
@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.
Created 09-04-2023 01:16 PM
@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,