<?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: How can we read a flowfile content with a python script ? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-can-we-read-a-flowfile-content-with-a-python-script/m-p/373267#M241539</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/97656"&gt;@Ghilani&lt;/a&gt;&amp;nbsp;You should know these 3 articles intimately if you want to use Execute Script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;A href="https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-1/ta-p/248922" target="_blank" rel="noopener"&gt;https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-1/ta-p/248922&lt;/A&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;A href="https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-2/ta-p/249018" target="_blank" rel="noopener"&gt;https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-2/ta-p/249018&lt;/A&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;A href="https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-3/ta-p/249148" target="_blank" rel="noopener"&gt;https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-3/ta-p/249148&lt;/A&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;That said, it's sometimes helpful for me to see a working example and modify from there.&amp;nbsp; As such, here is a github with a sample flow definition file (&lt;A class="Link--primary" href="https://github.com/cldr-steven-matison/Fraud-Prevention-With-Cloudera-SSB/blob/main/Templates/01_Fraud_Detection_Demo_Params_ExecuteScript.json" target="_blank" rel="noopener"&gt;01_Fraud_Detection_Demo_Params_ExecuteScript.json&lt;/A&gt;) and script file(&lt;A class="Link--primary" href="https://github.com/cldr-steven-matison/Fraud-Prevention-With-Cloudera-SSB/blob/main/Templates/Fraud%20Demo%20ExecuteScript.py" target="_blank" rel="noopener"&gt;Fraud Demo ExecuteScript.py&lt;/A&gt;) that should work out of the box:&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&lt;A href="https://github.com/cldr-steven-matison/Fraud-Prevention-With-Cloudera-SSB/tree/main/Templates" target="_blank" rel="noopener"&gt;https://github.com/cldr-steven-matison/Fraud-Prevention-With-Cloudera-SSB/tree/main/Templates&lt;/A&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;Pay attention to imports and, then line 160 is what you want to get the flowfile.&amp;nbsp; &amp;nbsp;My flow ignores the content, but you should be able to find references in the Part 1 cookbook for anything you want to do w/ flowfile content.&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2023 16:18:36 GMT</pubDate>
    <dc:creator>steven-matison</dc:creator>
    <dc:date>2023-06-26T16:18:36Z</dc:date>
    <item>
      <title>How can we read a flowfile content with a python script ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-we-read-a-flowfile-content-with-a-python-script/m-p/359708#M238170</link>
      <description>&lt;P&gt;the example is the next:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ghilani_0-1671195696165.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36479iE8D9AA8621DDBDE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ghilani_0-1671195696165.png" alt="Ghilani_0-1671195696165.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;GenerateFlowFile content:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ghilani_1-1671195844692.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36480i815A161503637674/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ghilani_1-1671195844692.png" alt="Ghilani_1-1671195844692.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want to clean the ETX character with a python script (Nifi wasn't able to clean it with replaceText), so I decided to pass the list to a python script to clean it, but am not sure how to read the Flowfile content.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ghilani_2-1671196414290.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36481iEE6EDDEF538B2794/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ghilani_2-1671196414290.png" alt="Ghilani_2-1671196414290.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The list (my_list) should be passed as Flowfile to the python script.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 13:17:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-we-read-a-flowfile-content-with-a-python-script/m-p/359708#M238170</guid>
      <dc:creator>Ghilani</dc:creator>
      <dc:date>2022-12-16T13:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can we read a flowfile content with a python script ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-we-read-a-flowfile-content-with-a-python-script/m-p/373192#M241522</link>
      <description>&lt;P&gt;Have you tried these examples?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-1/ta-p/248922" target="_blank"&gt;https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-1/ta-p/248922&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2023 19:24:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-we-read-a-flowfile-content-with-a-python-script/m-p/373192#M241522</guid>
      <dc:creator>joseomjr</dc:creator>
      <dc:date>2023-06-25T19:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can we read a flowfile content with a python script ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-we-read-a-flowfile-content-with-a-python-script/m-p/373267#M241539</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/97656"&gt;@Ghilani&lt;/a&gt;&amp;nbsp;You should know these 3 articles intimately if you want to use Execute Script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;A href="https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-1/ta-p/248922" target="_blank" rel="noopener"&gt;https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-1/ta-p/248922&lt;/A&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;A href="https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-2/ta-p/249018" target="_blank" rel="noopener"&gt;https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-2/ta-p/249018&lt;/A&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;A href="https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-3/ta-p/249148" target="_blank" rel="noopener"&gt;https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-3/ta-p/249148&lt;/A&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;That said, it's sometimes helpful for me to see a working example and modify from there.&amp;nbsp; As such, here is a github with a sample flow definition file (&lt;A class="Link--primary" href="https://github.com/cldr-steven-matison/Fraud-Prevention-With-Cloudera-SSB/blob/main/Templates/01_Fraud_Detection_Demo_Params_ExecuteScript.json" target="_blank" rel="noopener"&gt;01_Fraud_Detection_Demo_Params_ExecuteScript.json&lt;/A&gt;) and script file(&lt;A class="Link--primary" href="https://github.com/cldr-steven-matison/Fraud-Prevention-With-Cloudera-SSB/blob/main/Templates/Fraud%20Demo%20ExecuteScript.py" target="_blank" rel="noopener"&gt;Fraud Demo ExecuteScript.py&lt;/A&gt;) that should work out of the box:&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&lt;A href="https://github.com/cldr-steven-matison/Fraud-Prevention-With-Cloudera-SSB/tree/main/Templates" target="_blank" rel="noopener"&gt;https://github.com/cldr-steven-matison/Fraud-Prevention-With-Cloudera-SSB/tree/main/Templates&lt;/A&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;Pay attention to imports and, then line 160 is what you want to get the flowfile.&amp;nbsp; &amp;nbsp;My flow ignores the content, but you should be able to find references in the Part 1 cookbook for anything you want to do w/ flowfile content.&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 16:18:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-we-read-a-flowfile-content-with-a-python-script/m-p/373267#M241539</guid>
      <dc:creator>steven-matison</dc:creator>
      <dc:date>2023-06-26T16:18:36Z</dc:date>
    </item>
  </channel>
</rss>

