<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Nifi bash scripts execution and output in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-bash-scripts-execution-and-output/m-p/210049#M69334</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/24249/foivos.html" nodeid="24249"&gt;@Foivos A&lt;/A&gt; The output.stream relation from &lt;STRONG&gt;ExecuteStreamCommand&lt;/STRONG&gt; contains the stdout from the command executed.&lt;/P&gt;&lt;P&gt;Unless you do cat &amp;lt;unzipped_file&amp;gt; at the end of your script you won't see anything on that relation. And this would only work if you only have 1 unzipped file of course.&lt;/P&gt;&lt;P&gt;The way I did this was to have the script "echo" at the end the names of the local files, one per line. This output will go to the output.stream relation and from there you can do SplitText to split the output by line followed by a FetchFile -&amp;gt; PutHDFS.&lt;/P&gt;&lt;P&gt;If you're still interested, I can share my flow and the scripts, but as Abdelkrim mentioned, UnpackContent should do the job, even for very large files as UnpackContent followed by PutHDFS will be streamed so will not affect the NiFi heap.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2017 01:22:47 GMT</pubDate>
    <dc:creator>aanghel</dc:creator>
    <dc:date>2017-10-12T01:22:47Z</dc:date>
    <item>
      <title>Nifi bash scripts execution and output</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-bash-scripts-execution-and-output/m-p/210047#M69332</link>
      <description>&lt;P&gt;I have a directory with zip archives in the local filesystem of the Nifi server, and i would like to create a flow that unzips these archives with a bash script and then puts them in HDFS.&lt;/P&gt;&lt;P&gt;The problem i have is that i cannot direct the output of the bash script in a correct way to the &lt;STRONG&gt;PutHDFS&lt;/STRONG&gt; processor so that it parses the unzipped files. &lt;/P&gt;&lt;P&gt;1) With the use of &lt;STRONG&gt;ExecuteStreamCommand&lt;/STRONG&gt; processor i have 2 options for the outgoing flow, the &lt;STRONG&gt;original &lt;/STRONG&gt;relationship that contains the initial zipped archive and the &lt;STRONG&gt;outputstream &lt;/STRONG&gt;relationship which it should be what i am looking for but it transfers only an empty file with the same name with the original. How should be this processor be configured when it runs a bash script/command to correctly contain the files produced from this script/command?&lt;/P&gt;&lt;P&gt;2) With the use of &lt;STRONG&gt;ExecuteProcess&lt;/STRONG&gt; processor, where there is only a success/failure relationship and also this does not help to pass the outgoing flow as input of the PutHDFS processor to move the unzipped files to HDFS.&lt;/P&gt;&lt;P&gt;Any help would be greately appreciated!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="39733-nifiq.png" style="width: 2101px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16755i1325E4D09DCACB8D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="39733-nifiq.png" alt="39733-nifiq.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 04:10:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-bash-scripts-execution-and-output/m-p/210047#M69332</guid>
      <dc:creator>foivos</dc:creator>
      <dc:date>2019-08-18T04:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi bash scripts execution and output</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-bash-scripts-execution-and-output/m-p/210048#M69333</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/24249/foivos.html" nodeid="24249"&gt;@Foivos A&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Why not use UnpackContent or CompressContent instead of Execute process ?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.4.0/org.apache.nifi.processors.standard.UnpackContent/index.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.4.0/org.apache.nifi.processors.standard.UnpackContent/index.html&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.4.0/org.apache.nifi.processors.standard.CompressContent/index.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.4.0/org.apache.nifi.processors.standard.CompressContent/index.html&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Does UnpackContent suits your need ?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 13:20:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-bash-scripts-execution-and-output/m-p/210048#M69333</guid>
      <dc:creator>ahadjidj</dc:creator>
      <dc:date>2017-10-11T13:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi bash scripts execution and output</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-bash-scripts-execution-and-output/m-p/210049#M69334</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/24249/foivos.html" nodeid="24249"&gt;@Foivos A&lt;/A&gt; The output.stream relation from &lt;STRONG&gt;ExecuteStreamCommand&lt;/STRONG&gt; contains the stdout from the command executed.&lt;/P&gt;&lt;P&gt;Unless you do cat &amp;lt;unzipped_file&amp;gt; at the end of your script you won't see anything on that relation. And this would only work if you only have 1 unzipped file of course.&lt;/P&gt;&lt;P&gt;The way I did this was to have the script "echo" at the end the names of the local files, one per line. This output will go to the output.stream relation and from there you can do SplitText to split the output by line followed by a FetchFile -&amp;gt; PutHDFS.&lt;/P&gt;&lt;P&gt;If you're still interested, I can share my flow and the scripts, but as Abdelkrim mentioned, UnpackContent should do the job, even for very large files as UnpackContent followed by PutHDFS will be streamed so will not affect the NiFi heap.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 01:22:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-bash-scripts-execution-and-output/m-p/210049#M69334</guid>
      <dc:creator>aanghel</dc:creator>
      <dc:date>2017-10-12T01:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi bash scripts execution and output</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-bash-scripts-execution-and-output/m-p/210050#M69335</link>
      <description>&lt;P&gt;CompressContent works fine for gzip archives. Thanks a lot, still exploring Nifi processors possibilities&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 16:05:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-bash-scripts-execution-and-output/m-p/210050#M69335</guid>
      <dc:creator>foivos</dc:creator>
      <dc:date>2017-10-12T16:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi bash scripts execution and output</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-bash-scripts-execution-and-output/m-p/210051#M69336</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/10940/aanghel.html" nodeid="10940"&gt;@Alexandru Anghel&lt;/A&gt;, ive uploaded a new question with my whole use case and logic &lt;A href="https://community.hortonworks.com/questions/140572/nifi-flow-bash-script-execution-regex-on-stdout-fo.html"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Any help really appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 21:25:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-bash-scripts-execution-and-output/m-p/210051#M69336</guid>
      <dc:creator>foivos</dc:creator>
      <dc:date>2017-10-12T21:25:27Z</dc:date>
    </item>
  </channel>
</rss>

