<?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 Question: How to reference flow file in processor in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Question-How-to-reference-flow-file-in-processor/m-p/163471#M41328</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2593/zackriesland.html" nodeid="2593"&gt;@Zack Riesland&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You would have to use ExtractText processor to extract the path and set it as an attribute of your flow file. Then you can use this attribute using expression language in the next processors.&lt;/P&gt;&lt;P&gt;Let's say you extract .* to put it as attribute "mypath", then in following processor, for properties accepting expression language, you can reference this value using ${mypath}.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Sep 2016 17:40:41 GMT</pubDate>
    <dc:creator>pvillard</dc:creator>
    <dc:date>2016-09-21T17:40:41Z</dc:date>
    <item>
      <title>NiFi Question: How to reference flow file in processor</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Question-How-to-reference-flow-file-in-processor/m-p/163470#M41327</link>
      <description>&lt;P&gt;(I'm still getting familiar w/ NiFi, so this might have a really obvious answer)&lt;/P&gt;&lt;P&gt;I have a flow where I take a text file that contains a per-line list of files. I grab this file with a FetchFile processor, and then feed the output to a SplitText processor, giving me one flow file per row. &lt;/P&gt;&lt;P&gt;So my flow file is literally just a string with a file path "x", like '/home/zack/my_folder/my_file'.&lt;/P&gt;&lt;P&gt;Then, I want to add either a FetchFile processor or a ExecuteStream processor to get the file represented by "x" and copy it to a different folder. &lt;/P&gt;&lt;P&gt;However, I can't figure out how to reference "x".&lt;/P&gt;&lt;P&gt;Is there a way, using the markup language I would guess, to somehow get a handle on that file path string so I can use it?&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 16:54:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Question-How-to-reference-flow-file-in-processor/m-p/163470#M41327</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2016-09-21T16:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Question: How to reference flow file in processor</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Question-How-to-reference-flow-file-in-processor/m-p/163471#M41328</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2593/zackriesland.html" nodeid="2593"&gt;@Zack Riesland&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You would have to use ExtractText processor to extract the path and set it as an attribute of your flow file. Then you can use this attribute using expression language in the next processors.&lt;/P&gt;&lt;P&gt;Let's say you extract .* to put it as attribute "mypath", then in following processor, for properties accepting expression language, you can reference this value using ${mypath}.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 17:40:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Question-How-to-reference-flow-file-in-processor/m-p/163471#M41328</guid>
      <dc:creator>pvillard</dc:creator>
      <dc:date>2016-09-21T17:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Question: How to reference flow file in processor</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Question-How-to-reference-flow-file-in-processor/m-p/163472#M41329</link>
      <description>&lt;P&gt;Thanks Pierre,&lt;/P&gt;&lt;P&gt;A quick followup question: &lt;/P&gt;&lt;P&gt;How can I use the markup language to strip the path from a file?&lt;/P&gt;&lt;P&gt;So, in the example above, how do I get 'my_file' from 'home/zack/my_folder/my_file' ?&lt;/P&gt;&lt;P&gt;I'm guessing I use a UpdateAttribute processor... thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 03:09:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Question-How-to-reference-flow-file-in-processor/m-p/163472#M41329</guid>
      <dc:creator>zack_riesland</dc:creator>
      <dc:date>2016-09-22T03:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Question: How to reference flow file in processor</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Question-How-to-reference-flow-file-in-processor/m-p/163473#M41330</link>
      <description>&lt;P&gt;Yes correct. You could also do both in once with ExtractText processor, but you definitely can use UpdateAttribute and expression language functions to get the result you want. Also if you only need the filename for a processor in a property accepting expression language, you don't need the intermediate step. For example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;${mypath:substringAfterLast('/')}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html"&gt;https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 04:07:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Question-How-to-reference-flow-file-in-processor/m-p/163473#M41330</guid>
      <dc:creator>pvillard</dc:creator>
      <dc:date>2016-09-22T04:07:20Z</dc:date>
    </item>
  </channel>
</rss>

