Remove from _source.fieldA if fieldA is zero


I am using ES 7.10.2 and wanted to remove from existing indices _source fieldA if fieldA is zero.
I tried to use update_by_query > pipeline > processor > remove to remove a field if it's value is zero but when I ran the update_by_query with pipeline, i encountered null_pointer_exception
reason: Cannot Invoke "Object.getClass()" because "callArgs[0]" is null"

Below is my code for ingest pipeline

PUT _ingest/pipeline/set_fieldA_null
   "description" : "set fieldA from zero to null",
   "processors": [
      "remove": {
          "if": "ctx._source.fieldA == 0",
          "field": "ctx._source.fieldA"

Below is my API call
POST myindexA/_update_by_query?pipeline=set_fieldA_null

Any help is appreciated

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.