title: Elasticsearch pre-processing to remove null fields as part of ingest
body: <p>I have a use case where an API i'm calling to retrieve data to put into elasticsearch is returning nulls. </p>
  
  <p>I need to write an ingest pipeline that uses processors to remove all null fields before writing it into elasticsearch. Processors may or may not use painless scripting.</p>
  
  <p>Here is a sample payload that i currently get from the API</p>
  
  <pre><code>{
      "master_desc": "TESTING PART",
      "date_added": "2019-10-24T09:30:03",
      "master_no": {
        "master_no": 18460110,
        "barcode": "NLSKYTEST1-1",
        "external_key": null,
        "umid": null
      }
    }
  </code></pre>
  
  <p>The pipeline should ideally insert the document as -</p>
  
  <pre><code>{
      "master_desc": "TESTING PART",
      "date_added": "2019-10-24T09:30:03",
      "master_no": {
        "master_no": 18460110,
        "barcode": "NLSKYTEST1-1"
      }
  }
  </code></pre>
  
  <p>Note, the fields are dynamic so i can't write a processor that checks for nulls against a defined set of fields.</p>
  
  <p>Thanks!</p>