<?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: Problem with assigning values to attributes in NiFi in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Problem-with-assigning-values-to-attributes-in-NiFi/m-p/199844#M161876</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/76211/wojciechleszczynski.html" nodeid="76211"&gt;@Wojtek&lt;/A&gt;&lt;P&gt;I believe you are misunderstanding how the UpdateAttribute processor functions.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Each new property you add expects a property name (this becomes name of attribute being created or updated) and a value.  The value can be a string or a NiFi Expression Language (EL) statement.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;In your screenshot above you have created EL statements. For example&lt;/P&gt;&lt;P&gt;Property = bytes&lt;BR /&gt;Value = ${bytes}&lt;/P&gt;&lt;P&gt;What the above will actually do is:&lt;/P&gt;&lt;P&gt;- The EL statement "${bytes}" tells NiFi to try to locate an NiFi attribute (At no time does the updateAttribute processor read the content of the FlowFile) with a property name of bytes and return its assigned value.  That returned value will then be used to change the existing value assigned to the FlowFile attribute "bytes" or create a new FlowFile attribute with property name "bytes" and assign the value to that.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;NiFi searches for NiFi Attributes in the following hierarchy:&lt;/P&gt;&lt;P&gt;1. NiFi checks all existing attributes assigned already to FlowFile being processed.&lt;/P&gt;&lt;P&gt;2. NiFi checks all in scope process group variables &lt;/P&gt;&lt;P&gt;3. NiFi checks the NIFi variable registry file&lt;/P&gt;&lt;P&gt;4. NiFi checks the NiFi JVM properties&lt;/P&gt;&lt;P&gt;5. NiFi checks the NIFi user system environment variables.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Since the attribute "bytes" does not exsit in any of these places you are ending up with no value or empty string values being set on all these new properties.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Since you are trying to extract values from the content and assign those to FlowFile attributes, you will want to use a different processor.  Perhaps ExtractText instead.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.&lt;/P&gt;</description>
    <pubDate>Tue, 18 Sep 2018 19:51:01 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2018-09-18T19:51:01Z</dc:date>
  </channel>
</rss>

