You can accomplish this by combining the values of fieldA and fieldB to a multifield, and then make the multifield an actual multivalue field and use mvexpand on that.
Here's a run-anywhere search you can try:
| gentimes start=-1
| eval f="100,0;0,200;300,400;700,800"
| table f
| makemv f delim=";"
| mvexpand f
| rex field=f "(?<fieldA>\d+),(?<fieldB>\d+)"
| fields - f
| eval fieldA = if(fieldA==0, null, fieldA)
| eval fieldB = if(fieldB==0, null, fieldB)
| eval source="foo"
| eval multifield = fieldA + ";" + fieldB
| eval multifield = coalesce(multifield, fieldA, fieldB)
| makemv multifield delim=";"
| mvexpand multifield
| table source fieldA fieldB multifield
| join left=L right=R where L.multifield = R.fieldC
[ gentimes start=-1
| eval fieldC="100,200,300,400,500,600"
| table fieldC
| makemv fieldC delim=","
| mvexpand fieldC
| eval source="bar" ]
| table L.source R.source L.fieldA L.fieldB L.multifield R.fieldC
In your case it can probably be done like this:
source="foo"
| eval multifield = fieldA + ";" + fieldB
| eval multifield = coalesce(multifield, fieldA, fieldB)
| makemv multifield delim=";"
| mvexpand multifield
| table source fieldA fieldB multifield
| join left=L right=R where L.multifield = R.fieldC [ search source="bar" ]
| table L.source R.source L.fieldA L.fieldB L.multifield R.fieldC
... View more