<?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 NIFI - How to compute average across flowfiles? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-How-to-compute-average-across-flowfiles/m-p/126639#M51461</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I am using Nifi and I am pulling JSON data from a kafka topic using ConsumeKafka processor. I need to compute an average of a particular attribute's value across multiple flowfiles in a given time window. Any ideas on how this can be done? I have tried using EvaluateJsonPath and UpdateAttribute to do this but it seems that UpdateAttribute only allows me to do mathematical operations on the current flowfile and I cannot access the previous flowfile using this processor. Is there a processor that can do this?&lt;/P&gt;&lt;P&gt;Thanks. &lt;/P&gt;</description>
    <pubDate>Thu, 12 Jan 2017 23:02:20 GMT</pubDate>
    <dc:creator>ranjits</dc:creator>
    <dc:date>2017-01-12T23:02:20Z</dc:date>
    <item>
      <title>NIFI - How to compute average across flowfiles?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-How-to-compute-average-across-flowfiles/m-p/126639#M51461</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I am using Nifi and I am pulling JSON data from a kafka topic using ConsumeKafka processor. I need to compute an average of a particular attribute's value across multiple flowfiles in a given time window. Any ideas on how this can be done? I have tried using EvaluateJsonPath and UpdateAttribute to do this but it seems that UpdateAttribute only allows me to do mathematical operations on the current flowfile and I cannot access the previous flowfile using this processor. Is there a processor that can do this?&lt;/P&gt;&lt;P&gt;Thanks. &lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 23:02:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-How-to-compute-average-across-flowfiles/m-p/126639#M51461</guid>
      <dc:creator>ranjits</dc:creator>
      <dc:date>2017-01-12T23:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI - How to compute average across flowfiles?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-How-to-compute-average-across-flowfiles/m-p/126640#M51462</link>
      <description>&lt;P&gt;In an upcoming release you will be able to keep stateful variables using UpdateAttribute (&lt;A target="_blank" href="https://issues.apache.org/jira/browse/NIFI-1582"&gt;NIFI-1582&lt;/A&gt;), the author envisions it being able to support running averages. Also I started an AggregateValues processor under &lt;A href="https://issues.apache.org/jira/browse/NIFI-2735"&gt;NIFI-2735&lt;/A&gt;, but haven't been able to finish it yet, and it works on micro-batches (such as files created from a split processor like SplitJson) rather than rolling windows.&lt;/P&gt;&lt;P&gt;In the meantime if you are familiar with a scripting language such as Groovy, Jython, Javascript, or JRuby you could use &lt;A target="_blank" href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.script.ExecuteScript/index.html"&gt;ExecuteScript&lt;/A&gt; or &lt;A target="_blank" href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.script.InvokeScriptedProcessor/index.html"&gt;InvokeScriptedProcessor&lt;/A&gt;, they have access (via the ProcessContext) to the StateManager, where you could keep state, averages, etc, across flow files over time.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2017 23:12:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NIFI-How-to-compute-average-across-flowfiles/m-p/126640#M51462</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2017-01-12T23:12:26Z</dc:date>
    </item>
  </channel>
</rss>

