<?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 How to provide filenames dynamically in NIFI? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-provide-filenames-dynamically-in-NIFI/m-p/279809#M208473</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;I have a zipped file which contains so many text files. I used unpackContent processor to unzip the files. I want to store those unzipped files in another location. But the file names should be replaced with file1.txt, file2.txt, file3.txt and so on. How can I give file names dynamically? I thought updateAttribute can be used in this. But I'm not sure at the expression language to get this done. Can anyone help me to write a expression language in updateAttribute processor or any alternative processor/solution for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Oct 2019 04:55:07 GMT</pubDate>
    <dc:creator>girish6</dc:creator>
    <dc:date>2019-10-10T04:55:07Z</dc:date>
    <item>
      <title>How to provide filenames dynamically in NIFI?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-provide-filenames-dynamically-in-NIFI/m-p/279809#M208473</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;I have a zipped file which contains so many text files. I used unpackContent processor to unzip the files. I want to store those unzipped files in another location. But the file names should be replaced with file1.txt, file2.txt, file3.txt and so on. How can I give file names dynamically? I thought updateAttribute can be used in this. But I'm not sure at the expression language to get this done. Can anyone help me to write a expression language in updateAttribute processor or any alternative processor/solution for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 04:55:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-provide-filenames-dynamically-in-NIFI/m-p/279809#M208473</guid>
      <dc:creator>girish6</dc:creator>
      <dc:date>2019-10-10T04:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to provide filenames dynamically in NIFI?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-provide-filenames-dynamically-in-NIFI/m-p/279908#M208530</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/70164"&gt;@girish6&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NiFi Expression language does have a function that will increment a number, but it does not reset back to zero (unless you restart NiFi) and is incremented globally across call calls to that function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-10-10 at 12.37.15 PM.png" style="width: 539px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/24894i629E0D6836D6A1B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-10-10 at 12.37.15 PM.png" alt="Screen Shot 2019-10-10 at 12.37.15 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So while this function will give each FlowFile a unique filename per NiFi node, there is no guarantee that they will be sequential or will start at 0 for new source zip file you extract.&amp;nbsp; If this works for your use case the NiFi Expression language statement would look like this in the UpdateAttribute processor:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-10-10 at 12.44.10 PM.png" style="width: 363px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/24897i2AA536A1F7247C80/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-10-10 at 12.44.10 PM.png" alt="Screen Shot 2019-10-10 at 12.44.10 PM.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;If you are just looking for filename uniqueness, a better solution may be to instead append the FlowFile's uniquely assigned UUID to the filename instead as follows:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-10-10 at 12.46.25 PM.png" style="width: 377px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/24898iD7AF384C4D422398/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-10-10 at 12.46.25 PM.png" alt="Screen Shot 2019-10-10 at 12.46.25 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tips:&amp;nbsp;&lt;BR /&gt;1. There is an expression language guide in the embedded help of your NiFi installation found by clicking on the global menu icon in upper right corner.&lt;BR /&gt;2. Within a NiFi processor property that support NiFi EL you can display a list of functions with details by typing "${" (signifies start of an EL statement) and then hold "Control" while clicking space bar.&amp;nbsp; This also works if you are mid statement and type ":"then "control" + click spacebar.&lt;BR /&gt;&lt;BR /&gt;Examples:&lt;BR /&gt;&lt;STRONG&gt;file-${&amp;nbsp;&lt;/STRONG&gt; &amp;nbsp;(then cntrl+spacebar)&lt;BR /&gt;&lt;STRONG&gt;${uuid:&lt;/STRONG&gt;&amp;nbsp; (then cntrl+spacebar)&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Matt&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 16:58:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-provide-filenames-dynamically-in-NIFI/m-p/279908#M208530</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2019-10-10T16:58:42Z</dc:date>
    </item>
  </channel>
</rss>

