<?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: How to search and remove null values in flow file while loading to elastic search in nifi in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224868#M186731</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/73297/sdendukuri.html" nodeid="73297" target="_blank"&gt;@Suresh Dendukuri&lt;/A&gt;&lt;P&gt;One way of doing is to use Replace text processor to search for "NULL" in json record key/value and replace with empty string(blank), by using this way we can replace all NULL key/value pairs from flowfile content.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Method1:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Input:- &lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[ { "color": "black", "category": "hue", "type": "NULL", "code": { "rgba": [255,255,255,1], "hex": "#000" } }, { "color": "NULL", "category": "value", "code": { "rgba": [0,0,0,1], "hex": "#FFF" } }, { "color": "red", "category": "hue", "type": "primary", "code": { "rgba": NULL, "hex": "#FF0" } }]&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;ReplaceText 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="68572-replacetext.png" style="width: 2222px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15459iD8EE4B4E86014745/image-size/medium?v=v2&amp;amp;px=400" role="button" title="68572-replacetext.png" alt="68572-replacetext.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Search Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;("type": "NULL",|"color": "NULL",|"rgba": NULL,) //search for all possible NULL key/value pairs(| is used as OR)&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Value &lt;/P&gt;&lt;PRE&gt;//replace the with empty&lt;/PRE&gt;&lt;P&gt;Character Set
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;UTF-8&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Maximum Buffer Size
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;1 MB //needs to change the size if your flowfile is more than 1 MB&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Strategy
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Regex Replace&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Output From Replace Text Processor:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[ { "color": "black", "category": "hue",  "code": { "rgba": [255,255,255,1], "hex": "#000" } }, {  "category": "value", "code": { "rgba": [0,0,0,1], "hex": "#FFF" } }, { "color": "red", "category": "hue", "type": "primary", "code": {  "hex": "#FF0" } }]&lt;/PRE&gt;&lt;P&gt;All NULL values are replaced from the Flowfile Content.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(OR)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Method2:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This way we are using &lt;STRONG&gt;ConvertRecord&lt;/STRONG&gt; processor with &lt;STRONG&gt;JsonTreeReader &lt;/STRONG&gt;as Record Reader and &lt;STRONG&gt;JsonSetWriter &lt;/STRONG&gt;as Record Writer with the below property as &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Suppress Null Values
&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;Always Suppress //if the record having null value then we are not writing that into Output Flowfile.&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Flow:-&lt;/STRONG&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="68573-flow.png" style="width: 1863px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15460i28F011ED30352078/image-size/medium?v=v2&amp;amp;px=400" role="button" title="68573-flow.png" alt="68573-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;GenerateFlowFile:-&lt;/U&gt;&lt;BR /&gt;&lt;/STRONG&gt;This processor is used to generate sample records&lt;BR /&gt;Custom text property as&lt;/P&gt;&lt;PRE&gt;[ { "color": "black", "category": "hue", "type": "NULL", "code": { "rgba": [255,255,255,1], "hex": "#000" } }, { "color": "NULL", "category": "value", "code": { "rgba": [0,0,0,1], "hex": "#FFF" } }, { "color": "red", "category": "hue", "type": "primary", "code": { "rgba": NULL, "hex": "#FF0" } }]&lt;/PRE&gt;&lt;P&gt;add new property&lt;/P&gt;&lt;P&gt;schema.name&lt;/P&gt;&lt;PRE&gt;sch&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;ReplaceText:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As we are going to use &lt;STRONG&gt;ConvertRecord processor&lt;/STRONG&gt; and your input file having &lt;STRONG&gt;"NULL",NULL as values ,&lt;/STRONG&gt;but these are not treated as &lt;STRONG&gt;null&lt;/STRONG&gt; in &lt;STRONG&gt;Avro Schema Registry. &lt;/STRONG&gt;so we are going to preparing json records which are going to understand by ConvertRecord Processor.&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;Search Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;(NULL|"NULL") //search for NULL (or) "NULL" in the flowfile content &lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;null //replace with null&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Maximum Buffer Size
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;1 MB&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Strategy
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Regex Replace&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Evaluation Mode
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;Output:-&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[ { "color": "black", "category": "hue", "type": null, "code": { "rgba": [255,255,255,1], "hex": "#000" } }, { "color": null, "category": "value", "code": { "rgba": [0,0,0,1], "hex": "#FFF" } }, { "color": "red", "category": "hue", "type": "primary", "code": { "rgba": null, "hex": "#FF0" } }]&lt;/PRE&gt;&lt;P&gt;All the "NULL",NULL and replaced with null in the flowfile content.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;ConvertRecord Processor:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Record Reader/Writer controller services are configured and enable the controller service and add AvroSchemaRegistry as&lt;/P&gt;&lt;P&gt;we need to configure the avro schema with can match your input json record.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;JsontreeReader Configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="68575-jsontreereader.png" style="width: 1810px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15461iDF09DFA8B80BE79F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="68575-jsontreereader.png" alt="68575-jsontreereader.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ArrayAvroSchemaRegistry Configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sch&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{
  "type" : "record",
  "name" : "schema",
  "namespace" : "avroschema",
  "fields" : [ {
    "name" : "color",
    "type" : ["null","string"]
  }, {
    "name" : "category",
    "type" : "string"
  }, {
    "name" : "type",
    "type" : ["null","string"]
  }, {
    "name" : "code",
    "type" : {
      "type" : "record",
      "name" : "code",
      "fields" : [ {
        "name" : "rgba",
        "type" : { 
          "type" : "array",
          "items" : ["null","int"]
        } 
     }, {
        "name" : "hex",
        "type" : ["null","string"]
      }]
    }
  } ]
}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;JsonSetWriter Configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="68574-jsonsetwriter.png" style="width: 1487px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15462i21A7E76CEEFA0DB3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="68574-jsonsetwriter.png" alt="68574-jsonsetwriter.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Change the Supress Null Values to Always Suppress(we are not writing the null values for the json key's in the record)&lt;/P&gt;&lt;P&gt;Output:-&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;[{"color":"black","category":"hue","code":{"rgba":[255,255,255,1],"hex":"#000"}},{"category":"value","code":{"rgba":[0,0,0,1],"hex":"#FFF"}},{"color":"red","category":"hue","type":"primary","code":{"rgba":[],"hex":"#FF0"}}]&lt;/PRE&gt;&lt;P&gt;all the null values in the json records are not written in the output flowfile but the only issues is with rgba array even we are having null values for the array still jsonsetwriter writer an empty array for rgba&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;ReplaceText:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Now we are replacing the empty rgba empty array in this processor&lt;/P&gt;&lt;P&gt;Search Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;"rgba":[], //search for this value&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Value &lt;/P&gt;&lt;PRE&gt;//same as method1 replacetext configs&lt;/PRE&gt;&lt;P&gt;Maximum Buffer Size
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;1 MB&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Strategy
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Literal Replace&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Evaluation Mode
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Output:-&lt;BR /&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[{"color":"black","category":"hue","code":{"rgba":[255,255,255,1],"hex":"#000"}},{"category":"value","code":{"rgba":[0,0,0,1],"hex":"#FFF"}},{"color":"red","category":"hue","type":"primary","code":{"hex":"#FF0"}}]&lt;/PRE&gt;&lt;P&gt;I have attached my template below, save/upload the template and change as per your needs.&lt;/P&gt;&lt;P&gt; &lt;A href="https://community.cloudera.com/legacyfs/online/attachments/68576-remove-nulls-187756.xml" target="_blank"&gt;remove-nulls-187756.xml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-&lt;BR /&gt;If the Answer Addressed Your Question, &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>Sun, 18 Aug 2019 01:39:20 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T01:39:20Z</dc:date>
    <item>
      <title>How to search and remove null values in flow file while loading to elastic search in nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224865#M186728</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;How to search and remove NULL  value containing fields in incoming flow files in nifi . I was used replace test processor but it was removing only particular field. Here  the Incoming flow file is JSON file format . please provide your thoughts in theis regard&lt;/P&gt;</description>
      <pubDate>Sat, 21 Apr 2018 03:31:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224865#M186728</guid>
      <dc:creator>sdendukuri</dc:creator>
      <dc:date>2018-04-21T03:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and remove null values in flow file while loading to elastic search in nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224866#M186729</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;I have following JSON  flow file  and trying to remove null fields in the file and store into elastic search. here we need to remove Null containing fields from any type integer or character&lt;/P&gt;&lt;P&gt; [
    {
      "color": "black",
      "category": "hue",
      "type": "NULL",
      "code": {
        "rgba": [255,255,255,1],
        "hex": "#000"
      }
    },
    {
      "color": "NULL",
      "category": "value",
      "code": {
        "rgba": [0,0,0,1],
        "hex": "#FFF"
      }
    },
    {
      "color": "red",
      "category": "hue",
      "type": "primary",
      "code": {
        "rgba": NULL,
        "hex": "#FF0"
      }
    }]&lt;/P&gt;&lt;P&gt;Flow used  ==&amp;gt; Getfile ==&amp;gt;replacetest==&amp;gt;putelasticsearchrecords&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Apr 2018 05:23:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224866#M186729</guid>
      <dc:creator>sdendukuri</dc:creator>
      <dc:date>2018-04-21T05:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and remove null values in flow file while loading to elastic search in nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224867#M186730</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have following JSON flow file and trying to remove null fields in the file and store into elastic search. here we need to remove Null containing fields from any type integer or character&lt;/P&gt;&lt;P&gt;[ { "color": "black", "category": "hue", "type": "NULL", "code": { "rgba": [255,255,255,1], "hex": "#000" } }, { "color": "NULL", "category": "value", "code": { "rgba": [0,0,0,1], "hex": "#FFF" } }, { "color": "red", "category": "hue", "type": "primary", "code": { "rgba": NULL, "hex": "#FF0" } }]&lt;/P&gt;&lt;P&gt;Flow used ==&amp;gt; Getfile ==&amp;gt;replacetest==&amp;gt;putelasticsearchrecords&lt;/P&gt;&lt;P&gt;Desired Output&lt;/P&gt;&lt;P&gt;[ { "color": "black", "category": "hue",  "code": { "rgba": [255,255,255,1], "hex": "#000" } }, {  "category": "value", "code": { "rgba": [0,0,0,1], "hex": "#FFF" } }, { "color": "red", "category": "hue", "type": "primary", "code": { "hex": "#FF0" } }]&lt;/P&gt;</description>
      <pubDate>Sat, 21 Apr 2018 05:25:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224867#M186730</guid>
      <dc:creator>sdendukuri</dc:creator>
      <dc:date>2018-04-21T05:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and remove null values in flow file while loading to elastic search in nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224868#M186731</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/73297/sdendukuri.html" nodeid="73297" target="_blank"&gt;@Suresh Dendukuri&lt;/A&gt;&lt;P&gt;One way of doing is to use Replace text processor to search for "NULL" in json record key/value and replace with empty string(blank), by using this way we can replace all NULL key/value pairs from flowfile content.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Method1:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Input:- &lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[ { "color": "black", "category": "hue", "type": "NULL", "code": { "rgba": [255,255,255,1], "hex": "#000" } }, { "color": "NULL", "category": "value", "code": { "rgba": [0,0,0,1], "hex": "#FFF" } }, { "color": "red", "category": "hue", "type": "primary", "code": { "rgba": NULL, "hex": "#FF0" } }]&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;ReplaceText 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="68572-replacetext.png" style="width: 2222px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15459iD8EE4B4E86014745/image-size/medium?v=v2&amp;amp;px=400" role="button" title="68572-replacetext.png" alt="68572-replacetext.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Search Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;("type": "NULL",|"color": "NULL",|"rgba": NULL,) //search for all possible NULL key/value pairs(| is used as OR)&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Value &lt;/P&gt;&lt;PRE&gt;//replace the with empty&lt;/PRE&gt;&lt;P&gt;Character Set
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;UTF-8&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Maximum Buffer Size
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;1 MB //needs to change the size if your flowfile is more than 1 MB&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Strategy
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Regex Replace&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Output From Replace Text Processor:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[ { "color": "black", "category": "hue",  "code": { "rgba": [255,255,255,1], "hex": "#000" } }, {  "category": "value", "code": { "rgba": [0,0,0,1], "hex": "#FFF" } }, { "color": "red", "category": "hue", "type": "primary", "code": {  "hex": "#FF0" } }]&lt;/PRE&gt;&lt;P&gt;All NULL values are replaced from the Flowfile Content.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(OR)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Method2:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This way we are using &lt;STRONG&gt;ConvertRecord&lt;/STRONG&gt; processor with &lt;STRONG&gt;JsonTreeReader &lt;/STRONG&gt;as Record Reader and &lt;STRONG&gt;JsonSetWriter &lt;/STRONG&gt;as Record Writer with the below property as &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Suppress Null Values
&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;Always Suppress //if the record having null value then we are not writing that into Output Flowfile.&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Flow:-&lt;/STRONG&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="68573-flow.png" style="width: 1863px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15460i28F011ED30352078/image-size/medium?v=v2&amp;amp;px=400" role="button" title="68573-flow.png" alt="68573-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;GenerateFlowFile:-&lt;/U&gt;&lt;BR /&gt;&lt;/STRONG&gt;This processor is used to generate sample records&lt;BR /&gt;Custom text property as&lt;/P&gt;&lt;PRE&gt;[ { "color": "black", "category": "hue", "type": "NULL", "code": { "rgba": [255,255,255,1], "hex": "#000" } }, { "color": "NULL", "category": "value", "code": { "rgba": [0,0,0,1], "hex": "#FFF" } }, { "color": "red", "category": "hue", "type": "primary", "code": { "rgba": NULL, "hex": "#FF0" } }]&lt;/PRE&gt;&lt;P&gt;add new property&lt;/P&gt;&lt;P&gt;schema.name&lt;/P&gt;&lt;PRE&gt;sch&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;ReplaceText:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As we are going to use &lt;STRONG&gt;ConvertRecord processor&lt;/STRONG&gt; and your input file having &lt;STRONG&gt;"NULL",NULL as values ,&lt;/STRONG&gt;but these are not treated as &lt;STRONG&gt;null&lt;/STRONG&gt; in &lt;STRONG&gt;Avro Schema Registry. &lt;/STRONG&gt;so we are going to preparing json records which are going to understand by ConvertRecord Processor.&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;Search Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;(NULL|"NULL") //search for NULL (or) "NULL" in the flowfile content &lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;null //replace with null&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Maximum Buffer Size
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;1 MB&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Strategy
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Regex Replace&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Evaluation Mode
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;Output:-&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[ { "color": "black", "category": "hue", "type": null, "code": { "rgba": [255,255,255,1], "hex": "#000" } }, { "color": null, "category": "value", "code": { "rgba": [0,0,0,1], "hex": "#FFF" } }, { "color": "red", "category": "hue", "type": "primary", "code": { "rgba": null, "hex": "#FF0" } }]&lt;/PRE&gt;&lt;P&gt;All the "NULL",NULL and replaced with null in the flowfile content.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;ConvertRecord Processor:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Record Reader/Writer controller services are configured and enable the controller service and add AvroSchemaRegistry as&lt;/P&gt;&lt;P&gt;we need to configure the avro schema with can match your input json record.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;JsontreeReader Configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="68575-jsontreereader.png" style="width: 1810px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15461iDF09DFA8B80BE79F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="68575-jsontreereader.png" alt="68575-jsontreereader.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ArrayAvroSchemaRegistry Configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sch&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{
  "type" : "record",
  "name" : "schema",
  "namespace" : "avroschema",
  "fields" : [ {
    "name" : "color",
    "type" : ["null","string"]
  }, {
    "name" : "category",
    "type" : "string"
  }, {
    "name" : "type",
    "type" : ["null","string"]
  }, {
    "name" : "code",
    "type" : {
      "type" : "record",
      "name" : "code",
      "fields" : [ {
        "name" : "rgba",
        "type" : { 
          "type" : "array",
          "items" : ["null","int"]
        } 
     }, {
        "name" : "hex",
        "type" : ["null","string"]
      }]
    }
  } ]
}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;JsonSetWriter Configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="68574-jsonsetwriter.png" style="width: 1487px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15462i21A7E76CEEFA0DB3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="68574-jsonsetwriter.png" alt="68574-jsonsetwriter.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Change the Supress Null Values to Always Suppress(we are not writing the null values for the json key's in the record)&lt;/P&gt;&lt;P&gt;Output:-&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;[{"color":"black","category":"hue","code":{"rgba":[255,255,255,1],"hex":"#000"}},{"category":"value","code":{"rgba":[0,0,0,1],"hex":"#FFF"}},{"color":"red","category":"hue","type":"primary","code":{"rgba":[],"hex":"#FF0"}}]&lt;/PRE&gt;&lt;P&gt;all the null values in the json records are not written in the output flowfile but the only issues is with rgba array even we are having null values for the array still jsonsetwriter writer an empty array for rgba&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;ReplaceText:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Now we are replacing the empty rgba empty array in this processor&lt;/P&gt;&lt;P&gt;Search Value
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;"rgba":[], //search for this value&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Value &lt;/P&gt;&lt;PRE&gt;//same as method1 replacetext configs&lt;/PRE&gt;&lt;P&gt;Maximum Buffer Size
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;1 MB&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Replacement Strategy
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Literal Replace&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Evaluation Mode
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Output:-&lt;BR /&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;[{"color":"black","category":"hue","code":{"rgba":[255,255,255,1],"hex":"#000"}},{"category":"value","code":{"rgba":[0,0,0,1],"hex":"#FFF"}},{"color":"red","category":"hue","type":"primary","code":{"hex":"#FF0"}}]&lt;/PRE&gt;&lt;P&gt;I have attached my template below, save/upload the template and change as per your needs.&lt;/P&gt;&lt;P&gt; &lt;A href="https://community.cloudera.com/legacyfs/online/attachments/68576-remove-nulls-187756.xml" target="_blank"&gt;remove-nulls-187756.xml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-&lt;BR /&gt;If the Answer Addressed Your Question, &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>Sun, 18 Aug 2019 01:39:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224868#M186731</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T01:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and remove null values in flow file while loading to elastic search in nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224869#M186732</link>
      <description>&lt;P&gt;@shu , Thanks you very much for your detail explanation and options  to solve the problem . Appreciate your effort . Thanks for your time and help&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 20:11:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224869#M186732</guid>
      <dc:creator>sdendukuri</dc:creator>
      <dc:date>2018-04-23T20:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and remove null values in flow file while loading to elastic search in nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224870#M186733</link>
      <description>&lt;P&gt;I have used jolt transformer to transform json to json.&lt;/P&gt;&lt;P&gt;convertAvroToJSON =&amp;gt; JoltTransformerJSON =&amp;gt; ....&lt;/P&gt;&lt;P&gt;Here is sample specification &lt;/P&gt;&lt;P&gt;[ { "operation": "default", "spec": { "*": "XXXXX" } }, { "operation": "shift", "spec": { "*": { "XXXXX": null, "*": { "@1": "&amp;amp;2" } } } } ]&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 08:06:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-search-and-remove-null-values-in-flow-file-while/m-p/224870#M186733</guid>
      <dc:creator>chaitanya_chenn</dc:creator>
      <dc:date>2018-12-11T08:06:35Z</dc:date>
    </item>
  </channel>
</rss>

