<?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: Duplicate results using extract text processor for key value data in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Duplicate-results-using-extract-text-processor-for-key-value/m-p/234557#M196377</link>
    <description>&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2019 19:32:24 GMT</pubDate>
    <dc:creator>field_matt11</dc:creator>
    <dc:date>2019-07-04T19:32:24Z</dc:date>
    <item>
      <title>Duplicate results using extract text processor for key value data</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Duplicate-results-using-extract-text-processor-for-key-value/m-p/234555#M196375</link>
      <description>&lt;P&gt;If  i use an extract text processor to extract a key and value from a text, then i always get 2 attributes with the same value.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;If i use test: ([\w .]+) as my expression, then when i process a file with content "test: me" then the single data capture produces two attributes which as far as i can see are exactly the same.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;myattribute  :  "me"&lt;/P&gt;&lt;P&gt;myattribute.1 : "me"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Is there any way i can configure this to get just 1 attribute?  Or is there a better way to extract key= value data from a file content?&lt;/P&gt;&lt;P&gt;eg. attribute1:500, attribute2:600&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 18:32:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Duplicate-results-using-extract-text-processor-for-key-value/m-p/234555#M196375</guid>
      <dc:creator>field_matt11</dc:creator>
      <dc:date>2019-07-03T18:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate results using extract text processor for key value data</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Duplicate-results-using-extract-text-processor-for-key-value/m-p/234556#M196376</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/114955/fieldmatt11.html"&gt;@Matt Field&lt;/A&gt;&lt;/P&gt;&lt;P&gt;From NiFi &lt;A rel="noopener noreferrer noopener noreferrer noopener noreferrer noopener noreferrer" href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.5.0/org.apache.nifi.processors.standard.ExtractText/index.html" target="_blank"&gt;ExtractText&lt;/A&gt; docs:&lt;/P&gt;&lt;PRE&gt;The first capture group, if any found, will be placed into that attribute name.But all capture groups, including the matching string sequence itself will also be provided at that attribute name with an index value provided.&lt;/PRE&gt;&lt;P&gt;This is an expected behaviour from NiFi as you are having capture group in your &lt;STRONG&gt;regular expression&lt;/STRONG&gt;, so extract text processor adds &lt;STRONG&gt;index value to attribute name&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;For consistency use &lt;STRONG&gt;${myattribute}&lt;/STRONG&gt; without index value as the reference for the attribute value.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;If the answer is helpful to &lt;STRONG&gt;resolve the issue&lt;/STRONG&gt;, Login and Click on &lt;STRONG&gt;Accept&lt;/STRONG&gt; button below to close this thread.This will help other community users to find answers quickly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 10:09:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Duplicate-results-using-extract-text-processor-for-key-value/m-p/234556#M196376</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-07-04T10:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate results using extract text processor for key value data</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Duplicate-results-using-extract-text-processor-for-key-value/m-p/234557#M196377</link>
      <description>&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 19:32:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Duplicate-results-using-extract-text-processor-for-key-value/m-p/234557#M196377</guid>
      <dc:creator>field_matt11</dc:creator>
      <dc:date>2019-07-04T19:32:24Z</dc:date>
    </item>
  </channel>
</rss>

