<?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 - Validate vame of file in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Validate-vame-of-file/m-p/194281#M83810</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/97215/jricogar.html" nodeid="97215"&gt;@Pepelu Rico&lt;/A&gt;&lt;P&gt;Yes we can validate the &lt;STRONG&gt;name of the file and size of file&lt;/STRONG&gt; before ingesting into HDFS by using &lt;STRONG&gt;RouteOnAttribute&lt;/STRONG&gt; processor.&lt;/P&gt;&lt;P&gt;in NiFi we are having attributes to the flowfile as&lt;/P&gt;&lt;PRE&gt;1.${filename} //gets the filename of the flowfile
2.${fileSize} //gets the size in bytes of the flowfile&lt;/PRE&gt;&lt;P&gt;In &lt;STRONG&gt;RouteOnAttribute&lt;/STRONG&gt; processor add new property as&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;valid_files&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;${filename:equlas("&amp;lt;required_file_name&amp;gt;"):and(${fileSize:gt(0)})} &lt;/PRE&gt;&lt;P&gt;In the above expression we are using &lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#equals" target="_blank"&gt;NiFi expression language&lt;/A&gt; and checking the filename value &lt;STRONG&gt;equlas&lt;/STRONG&gt;(expression language function)&lt;STRONG&gt; to &amp;lt;required_file_name&amp;gt;&lt;/STRONG&gt; and checking&lt;STRONG&gt; fileSize value is greater than 0&lt;/STRONG&gt;, Then only the flowfiles will be tranferred into valid_files relation.&lt;/P&gt;&lt;P&gt;Feed only the &lt;STRONG&gt;valid_files relation to PutHDFS processor,&lt;/STRONG&gt; By using this relation we are storing only the files that satisfies the condition will be stored into HDFS.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;If the Answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button below to accept the answer,&lt;/STRONG&gt; That would be great help to Community users to find solution quickly for these kind of issues.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Sep 2018 17:00:08 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2018-09-25T17:00:08Z</dc:date>
    <item>
      <title>NIFI - Validate vame of file</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Validate-vame-of-file/m-p/194280#M83809</link>
      <description>&lt;P&gt;Hello, is possible validate the name of the file to tingest in HDFS? I mean, i need validate the name of the file is correct and the size is &amp;gt; 0, it's possible?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 15:43:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Validate-vame-of-file/m-p/194280#M83809</guid>
      <dc:creator>jricogar</dc:creator>
      <dc:date>2018-09-25T15:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI - Validate vame of file</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Validate-vame-of-file/m-p/194281#M83810</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/97215/jricogar.html" nodeid="97215"&gt;@Pepelu Rico&lt;/A&gt;&lt;P&gt;Yes we can validate the &lt;STRONG&gt;name of the file and size of file&lt;/STRONG&gt; before ingesting into HDFS by using &lt;STRONG&gt;RouteOnAttribute&lt;/STRONG&gt; processor.&lt;/P&gt;&lt;P&gt;in NiFi we are having attributes to the flowfile as&lt;/P&gt;&lt;PRE&gt;1.${filename} //gets the filename of the flowfile
2.${fileSize} //gets the size in bytes of the flowfile&lt;/PRE&gt;&lt;P&gt;In &lt;STRONG&gt;RouteOnAttribute&lt;/STRONG&gt; processor add new property as&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;valid_files&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;${filename:equlas("&amp;lt;required_file_name&amp;gt;"):and(${fileSize:gt(0)})} &lt;/PRE&gt;&lt;P&gt;In the above expression we are using &lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#equals" target="_blank"&gt;NiFi expression language&lt;/A&gt; and checking the filename value &lt;STRONG&gt;equlas&lt;/STRONG&gt;(expression language function)&lt;STRONG&gt; to &amp;lt;required_file_name&amp;gt;&lt;/STRONG&gt; and checking&lt;STRONG&gt; fileSize value is greater than 0&lt;/STRONG&gt;, Then only the flowfiles will be tranferred into valid_files relation.&lt;/P&gt;&lt;P&gt;Feed only the &lt;STRONG&gt;valid_files relation to PutHDFS processor,&lt;/STRONG&gt; By using this relation we are storing only the files that satisfies the condition will be stored into HDFS.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;If the Answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button below to accept the answer,&lt;/STRONG&gt; That would be great help to Community users to find solution quickly for these kind of issues.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 17:00:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-Validate-vame-of-file/m-p/194281#M83810</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-09-25T17:00:08Z</dc:date>
    </item>
  </channel>
</rss>

