I am not clearly following your use case.
FlowFiles consist of two parts, FlowFile attributes/metadata and FlowFile content.
You give example with "customefields_12345" and "customefields_12346".
Does this mean one FlowFile may have multiple "customefields_<some string>" attributes assigned to it?
How do you want to route FlowFiles where only some of those customfield attributes are null while others are not?
There are multiple ways to handle this using NiFi Expression Language (NEL)  and the routeOnAttribute  processor.
Above would return "true" if ANY of the NiFi FlowFile attributes starting with "customefield" is empty.
note: The isEmpty function returns true if the Subject is null, does not contain any characters or contains only white-space (new line, carriage return, space, tab), false otherwise.
There is another NEL subjectless function that would return "true" only if ALL FlowFileAttributes matching the Java regular expression were empty:
With the RouteOnAttribute processor you create/add dynamic properties and each of those becomes a new routable relationship on the processor. if the NEL statement configured for that dynamic property returns true that FlowFile routes to that relationship. Any FlowFile that does not return true for dynamic properties will get routed to the pre-existing relationship named "unmatched".
If you found this addressed your query, please take a moment to login and click "Accept" on this solution.