<?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 I want to delete attributes after pulling the data from mysql while pushing to the elastic search. in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/I-want-to-delete-attributes-after-pulling-the-data-from/m-p/223510#M72597</link>
    <description>&lt;P&gt;I am trying using update attribute processor but i am not able to do it..please tell me how to do it&lt;/P&gt;</description>
    <pubDate>Wed, 13 Dec 2017 02:35:39 GMT</pubDate>
    <dc:creator>sunil_devopsian</dc:creator>
    <dc:date>2017-12-13T02:35:39Z</dc:date>
    <item>
      <title>I want to delete attributes after pulling the data from mysql while pushing to the elastic search.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/I-want-to-delete-attributes-after-pulling-the-data-from/m-p/223510#M72597</link>
      <description>&lt;P&gt;I am trying using update attribute processor but i am not able to do it..please tell me how to do it&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 02:35:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/I-want-to-delete-attributes-after-pulling-the-data-from/m-p/223510#M72597</guid>
      <dc:creator>sunil_devopsian</dc:creator>
      <dc:date>2017-12-13T02:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: I want to delete attributes after pulling the data from mysql while pushing to the elastic search.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/I-want-to-delete-attributes-after-pulling-the-data-from/m-p/223511#M72598</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/51157/sunilkumar5031.html" nodeid="51157" target="_blank"&gt;@sunil kumar&lt;/A&gt;,&lt;BR /&gt;In update attributes processor delete attributes expression property expects attributes in regular expressions.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Delete Attributes Expression&lt;/TD&gt;&lt;TD&gt;Regular expression for attributes to be deleted from flowfiles.&lt;BR /&gt;&lt;STRONG&gt;Supports Expression Language: true&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;If you want to delete &lt;STRONG&gt;id,CompanyName&lt;/STRONG&gt; attributes from the flowfile then&lt;/P&gt;&lt;P&gt;Delete Attributes Expression&lt;/P&gt;&lt;PRE&gt;id|CompanyName&lt;/PRE&gt;&lt;P&gt;Same way if you want to delete more attrbutes keep them with &lt;STRONG&gt;pipe separated&lt;/STRONG&gt; or you can include &lt;STRONG&gt;matching regex&lt;/STRONG&gt; that can match all the attributes that you are desired to delete.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="44409-update.png" style="width: 1670px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15588i4AD6BD362A42780C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="44409-update.png" alt="44409-update.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;id|Company.* //matches with id attribute and all attribute names starting with Company 
id|Company //matches only id,Company attributes only&lt;/PRE&gt;&lt;P&gt;By taking reference you can change and configure Update Attribute processor as per your needs.&lt;/P&gt;&lt;P&gt;If the Answer helped to resolve your issue, Click on &lt;STRONG&gt;Accept button below&lt;/STRONG&gt; to accept the answer, That would be great help to Community users to find solution quickly for these kind of errors.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 01:54:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/I-want-to-delete-attributes-after-pulling-the-data-from/m-p/223511#M72598</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T01:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: I want to delete attributes after pulling the data from mysql while pushing to the elastic search.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/I-want-to-delete-attributes-after-pulling-the-data-from/m-p/223512#M72599</link>
      <description>&lt;P&gt;hey shu thanks for your quick response.&lt;/P&gt;&lt;P&gt;and yes i am trying the same way which you posted but the attributes are not deleting and they are comming into elastic search..&lt;/P&gt;&lt;P&gt;Do i need to change the nifi flow&lt;/P&gt;&lt;P&gt;Here is my nifi flow and update attributes screen&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="44411-updateattrb.png" style="width: 1184px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15586iE20AB0B39ECBC153/image-size/medium?v=v2&amp;amp;px=400" role="button" title="44411-updateattrb.png" alt="44411-updateattrb.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="44410-nififlow.png" style="width: 1221px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15587iED9F6A00DEC57FE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="44410-nififlow.png" alt="44410-nififlow.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 01:54:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/I-want-to-delete-attributes-after-pulling-the-data-from/m-p/223512#M72599</guid>
      <dc:creator>sunil_devopsian</dc:creator>
      <dc:date>2019-08-18T01:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: I want to delete attributes after pulling the data from mysql while pushing to the elastic search.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/I-want-to-delete-attributes-after-pulling-the-data-from/m-p/223513#M72600</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/51157/sunilkumar5031.html" nodeid="51157"&gt;@sunil kumar&lt;/A&gt;&lt;P&gt;We can do your case in different methods&lt;BR /&gt;
Before Put Elastic search processor we need to make the contents of the flowfile
without city in the contents of flowfile.&lt;/P&gt;&lt;P&gt;Let’s consider&lt;/P&gt;&lt;PRE&gt;[{&lt;BR /&gt;  "id":
"1",&lt;BR /&gt;  "name":
"Michael",&lt;BR /&gt;  "city":
"orlando"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;  "id":
"2",&lt;BR /&gt;  "name":
"John",&lt;BR /&gt;  "city":
"miami"&lt;BR /&gt;}]&lt;/PRE&gt;&lt;P&gt;You are having above json array with 2 records then you are
expecting &lt;/P&gt;&lt;PRE&gt;[{"id":1,"name":"Michael"},{"id":2,"name":"John"}]&lt;/PRE&gt;&lt;P&gt;i.e without city in the json message.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Method 1:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For this case if you are using NiFi 1.2+ there are convert
record processor which will help you to get this work done very easily.&lt;/P&gt;&lt;P&gt;I am attaching the xml document here and I tested with the
above json as input.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/44428-nifi12.xml"&gt;nifi12.xml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Method 2:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If you are using prior to NiFi 1.2&lt;/P&gt;&lt;P&gt;Then you need to use SplitJson processor after ConvertAVROtojson.&lt;/P&gt;&lt;P&gt;Then use Evaluate json Processor with Destination as
flowfile attribute&lt;/P&gt;&lt;P&gt;Then Attributes to Json processor to get only the required
attributes into your resultant content.&lt;/P&gt;&lt;P&gt;Now put elastic search processor gets only the required json
message elements.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Method 3:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;After splitjson use Replace text processor and put your logic
to capture the json message execept city element.&lt;/P&gt;&lt;P&gt;I have attached all the flow xml’s, you can download and
make sure with method will best fit for your case.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/44429-prior-nifi-12.xml"&gt;prior-nifi-12.xml&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 01:05:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/I-want-to-delete-attributes-after-pulling-the-data-from/m-p/223513#M72600</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2017-12-14T01:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: I want to delete attributes after pulling the data from mysql while pushing to the elastic search.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/I-want-to-delete-attributes-after-pulling-the-data-from/m-p/283933#M72601</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if I want to delete all attributes present in FlowFile except, id and CompanyName?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 07:41:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/I-want-to-delete-attributes-after-pulling-the-data-from/m-p/283933#M72601</guid>
      <dc:creator>ASG2020</dc:creator>
      <dc:date>2019-11-25T07:41:29Z</dc:date>
    </item>
  </channel>
</rss>

