<?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 Apache NiFi 1.10 : How to execute a python script as a processor in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-1-10-How-to-execute-a-python-script-as-a/m-p/285709#M211986</link>
    <description>&lt;P&gt;Disclaimer: crosspost from&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/59359158/apache-nifi-1-10-how-to-execute-a-python-script-as-a-processor" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/59359158/apache-nifi-1-10-how-to-execute-a-python-script-as-a-processor&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In NiFi &amp;lt;= v1.9 I used the following NiFi setup:&lt;BR /&gt;&lt;IMG src="https://ip1.i.lithium.com/d340fe6a3dd721661b288d6678772acddda7da3f/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f71525162582e706e67" border="0" alt="" width="858" height="181" /&gt;&lt;/P&gt;
&lt;P&gt;`GetTwitter` generates a JSON for every tweet gathered and attached to it there used to be a `ExecuteStreamCommand` that has the following parameters:&lt;BR /&gt;&lt;IMG src="https://ip1.i.lithium.com/24ff56dacd794f4a91a6cd0507bea0d6699c1a63/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f5a726242352e706e67" border="0" alt="" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This would allow me to get the flowfile as input, and I could analyse the content and do something (in this specific case I would put the content on Elasticsearch) - You could reach the same result if you do something like this `cat flowfile.json | python &amp;lt;scriptname&amp;gt;.py`&lt;/P&gt;
&lt;P&gt;But now in &amp;gt;= v1.10 it seems I cannot do the same. it gives me some error about parameters (it seems it wants to use the flowfile as parameter on calling the command/script instead, as it used to be, pass the flowfile as input.&lt;BR /&gt;It gives me the following error:&lt;BR /&gt;&lt;IMG src="https://ip1.i.lithium.com/9d28f293ab3093e2b25fd4a6e8a6dc481963e999/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f615865526f2e706e67" border="0" alt="" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;2019-12-16 14:28:44,953 ERROR [Timer-Driven Process Thread-2] o.a.n.p.standard.ExecuteStreamCommand ExecuteStreamCommand[id=ef1d15fb-016e-1000-3050-35fba1733f97] Transferring flow file StandardFlowFileRecord[uuid=c485d8aa-58e9-428c-84b1-b4acbd6275a7,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1576505352573-22, container=default, section=22], offset=663999, length=-1],offset=0,name=242802f9-5ffb-4a2c-90a5-27736459dfd0.json,size=0] to nonzero status. Executable command bash ended in an error: bash: line 1: $'{delete:status:id:1005156317567188992}\r': command not found
2019-12-16 14:28:44,962 ERROR [Timer-Driven Process Thread-2] o.a.n.p.standard.ExecuteStreamCommand ExecuteStreamCommand[id=ef1d15fb-016e-1000-3050-35fba1733f97] Transferring flow file StandardFlowFileRecord[uuid=5b617840-ba8e-47b3-9a27-06e8ec0f88bd,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1576505352573-22, container=default, section=22], offset=663999, length=-1],offset=0,name=eb9e236a-1ccb-4243-aa1c-e5de43746f80.json,size=0] to nonzero status. Executable command bash ended in an error: bash: line 1: $'{delete:status:id:1139832600422277120}\r': command not found&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems it takes the flowfile JSON as parameter instead of input .&lt;BR /&gt;Any ideas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Dec 2019 17:47:26 GMT</pubDate>
    <dc:creator>salvob14</dc:creator>
    <dc:date>2019-12-16T17:47:26Z</dc:date>
    <item>
      <title>Apache NiFi 1.10 : How to execute a python script as a processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-1-10-How-to-execute-a-python-script-as-a/m-p/285709#M211986</link>
      <description>&lt;P&gt;Disclaimer: crosspost from&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/59359158/apache-nifi-1-10-how-to-execute-a-python-script-as-a-processor" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/59359158/apache-nifi-1-10-how-to-execute-a-python-script-as-a-processor&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In NiFi &amp;lt;= v1.9 I used the following NiFi setup:&lt;BR /&gt;&lt;IMG src="https://ip1.i.lithium.com/d340fe6a3dd721661b288d6678772acddda7da3f/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f71525162582e706e67" border="0" alt="" width="858" height="181" /&gt;&lt;/P&gt;
&lt;P&gt;`GetTwitter` generates a JSON for every tweet gathered and attached to it there used to be a `ExecuteStreamCommand` that has the following parameters:&lt;BR /&gt;&lt;IMG src="https://ip1.i.lithium.com/24ff56dacd794f4a91a6cd0507bea0d6699c1a63/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f5a726242352e706e67" border="0" alt="" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This would allow me to get the flowfile as input, and I could analyse the content and do something (in this specific case I would put the content on Elasticsearch) - You could reach the same result if you do something like this `cat flowfile.json | python &amp;lt;scriptname&amp;gt;.py`&lt;/P&gt;
&lt;P&gt;But now in &amp;gt;= v1.10 it seems I cannot do the same. it gives me some error about parameters (it seems it wants to use the flowfile as parameter on calling the command/script instead, as it used to be, pass the flowfile as input.&lt;BR /&gt;It gives me the following error:&lt;BR /&gt;&lt;IMG src="https://ip1.i.lithium.com/9d28f293ab3093e2b25fd4a6e8a6dc481963e999/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f615865526f2e706e67" border="0" alt="" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;2019-12-16 14:28:44,953 ERROR [Timer-Driven Process Thread-2] o.a.n.p.standard.ExecuteStreamCommand ExecuteStreamCommand[id=ef1d15fb-016e-1000-3050-35fba1733f97] Transferring flow file StandardFlowFileRecord[uuid=c485d8aa-58e9-428c-84b1-b4acbd6275a7,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1576505352573-22, container=default, section=22], offset=663999, length=-1],offset=0,name=242802f9-5ffb-4a2c-90a5-27736459dfd0.json,size=0] to nonzero status. Executable command bash ended in an error: bash: line 1: $'{delete:status:id:1005156317567188992}\r': command not found
2019-12-16 14:28:44,962 ERROR [Timer-Driven Process Thread-2] o.a.n.p.standard.ExecuteStreamCommand ExecuteStreamCommand[id=ef1d15fb-016e-1000-3050-35fba1733f97] Transferring flow file StandardFlowFileRecord[uuid=5b617840-ba8e-47b3-9a27-06e8ec0f88bd,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1576505352573-22, container=default, section=22], offset=663999, length=-1],offset=0,name=eb9e236a-1ccb-4243-aa1c-e5de43746f80.json,size=0] to nonzero status. Executable command bash ended in an error: bash: line 1: $'{delete:status:id:1139832600422277120}\r': command not found&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems it takes the flowfile JSON as parameter instead of input .&lt;BR /&gt;Any ideas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 17:47:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-1-10-How-to-execute-a-python-script-as-a/m-p/285709#M211986</guid>
      <dc:creator>salvob14</dc:creator>
      <dc:date>2019-12-16T17:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi 1.10 : How to execute a python script as a processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-1-10-How-to-execute-a-python-script-as-a/m-p/285773#M212020</link>
      <description>&lt;P&gt;well, This is not really a problem with NiFi per se:&lt;BR /&gt;NiFi was installed with docker so I kept using the docker host as it was the correct machine.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Embarassing.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 08:16:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-1-10-How-to-execute-a-python-script-as-a/m-p/285773#M212020</guid>
      <dc:creator>salvob14</dc:creator>
      <dc:date>2019-12-17T08:16:57Z</dc:date>
    </item>
  </channel>
</rss>

