<?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 with updateattribute in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-with-updateattribute/m-p/200105#M74247</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11492/biswajit2015in.html" nodeid="11492" target="_blank"&gt;@Biswajit Chakraborty&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;If you are using GetFTP processor then after pulling files then processor going to add &lt;STRONG&gt;getftp.remote.source&lt;/STRONG&gt; attribute to the flowfile, then you can use this flowfile attribute then prepare filename in update attribute processor &lt;/P&gt;&lt;P&gt;Add new property in update attribute &lt;/P&gt;&lt;P&gt;filename&lt;/P&gt;&lt;PRE&gt;${filename}_${getftp.remote.source} //add remote source name to the filename &lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="56573-updateattribute.png" style="width: 1778px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17575iE652CA147112D6C8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="56573-updateattribute.png" alt="56573-updateattribute.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;as you can change the way of using expression language to change filename as following&lt;/P&gt;&lt;PRE&gt;${filename:append(${getftp.remote.source})} //result 711866091328995HDF04-1
(or)
${filename}${getftp.remote.source} //result 711866091328995HDF04-1&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Example:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if you are having &lt;STRONG&gt;filename&lt;/STRONG&gt; value as 711866091328995 and &lt;STRONG&gt;getftp.remote.source&lt;/STRONG&gt; value as HDF04-1 then output flowfile from update attribute will have filename as&lt;/P&gt;&lt;PRE&gt;711866091328995_HDF04-1 //because we are adding remote source value to filename with underscore&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="56571-updateattribute.png" style="width: 1734px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17576i66294D2B3800124A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="56571-updateattribute.png" alt="56571-updateattribute.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;if you are having issue with the &lt;STRONG&gt;same filenames &lt;/STRONG&gt;and they are getting overwritten,&lt;/P&gt;&lt;P&gt;The FlowFile will also have an attribute named &lt;STRONG&gt;uuid,&lt;/STRONG&gt; By using &lt;STRONG&gt;UUID(&lt;/STRONG&gt;&lt;STRONG&gt;which is a unique identifier for this FlowFile) as &lt;/STRONG&gt;filename, will keep every filename as unique so that we are not going to have any overwriting issues.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Configs:-&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;filename&lt;/P&gt;&lt;PRE&gt;${uuid}&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="56572-updateattribute.png" style="width: 1268px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17577i3ADE05D2A3587DD1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="56572-updateattribute.png" alt="56572-updateattribute.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 05:47:02 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T05:47:02Z</dc:date>
    <item>
      <title>NiFi with updateattribute</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-with-updateattribute/m-p/200104#M74246</link>
      <description>&lt;P&gt;Hi All , &lt;/P&gt;&lt;P&gt;In my project , where I am trying to read log files and process it in spark , I am using NiFi to read the file from tomcat log folder location and copy it to my Edge node in my hadoop cluster. &lt;/P&gt;&lt;P&gt;But the problem is that my Application (for which I am processing log files) is in cluster environment and in all 4 tomcat cluster log file names are same. So what I want to do , getFTP will get the log file from app server location , then data will flow into a updateAttribite processor , which will append the server and cluster identification(just something like server1Cluste1 or server2Cluster1) with the file name and then putFile will store the log file in local file system with new name. Which I will process in spark job. &lt;/P&gt;&lt;P&gt;Can any one help me out for configuration of  updateAttribute in my case? is there anything in updateAttribute by which I can identify from which server I am getting this file and depending on that can I change the file name to putFile? &lt;/P&gt;&lt;P&gt;Any help will be highly appreciated&lt;/P&gt;&lt;P&gt;Thanks in advance  &lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2018 02:41:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-with-updateattribute/m-p/200104#M74246</guid>
      <dc:creator>Biswajit16</dc:creator>
      <dc:date>2018-02-03T02:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi with updateattribute</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-with-updateattribute/m-p/200105#M74247</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11492/biswajit2015in.html" nodeid="11492" target="_blank"&gt;@Biswajit Chakraborty&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;If you are using GetFTP processor then after pulling files then processor going to add &lt;STRONG&gt;getftp.remote.source&lt;/STRONG&gt; attribute to the flowfile, then you can use this flowfile attribute then prepare filename in update attribute processor &lt;/P&gt;&lt;P&gt;Add new property in update attribute &lt;/P&gt;&lt;P&gt;filename&lt;/P&gt;&lt;PRE&gt;${filename}_${getftp.remote.source} //add remote source name to the filename &lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="56573-updateattribute.png" style="width: 1778px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17575iE652CA147112D6C8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="56573-updateattribute.png" alt="56573-updateattribute.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;as you can change the way of using expression language to change filename as following&lt;/P&gt;&lt;PRE&gt;${filename:append(${getftp.remote.source})} //result 711866091328995HDF04-1
(or)
${filename}${getftp.remote.source} //result 711866091328995HDF04-1&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Example:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if you are having &lt;STRONG&gt;filename&lt;/STRONG&gt; value as 711866091328995 and &lt;STRONG&gt;getftp.remote.source&lt;/STRONG&gt; value as HDF04-1 then output flowfile from update attribute will have filename as&lt;/P&gt;&lt;PRE&gt;711866091328995_HDF04-1 //because we are adding remote source value to filename with underscore&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="56571-updateattribute.png" style="width: 1734px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17576i66294D2B3800124A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="56571-updateattribute.png" alt="56571-updateattribute.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;if you are having issue with the &lt;STRONG&gt;same filenames &lt;/STRONG&gt;and they are getting overwritten,&lt;/P&gt;&lt;P&gt;The FlowFile will also have an attribute named &lt;STRONG&gt;uuid,&lt;/STRONG&gt; By using &lt;STRONG&gt;UUID(&lt;/STRONG&gt;&lt;STRONG&gt;which is a unique identifier for this FlowFile) as &lt;/STRONG&gt;filename, will keep every filename as unique so that we are not going to have any overwriting issues.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Configs:-&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;filename&lt;/P&gt;&lt;PRE&gt;${uuid}&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="56572-updateattribute.png" style="width: 1268px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17577i3ADE05D2A3587DD1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="56572-updateattribute.png" alt="56572-updateattribute.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 05:47:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-with-updateattribute/m-p/200105#M74247</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T05:47:02Z</dc:date>
    </item>
  </channel>
</rss>

