Flatmap to return 2 sets of Observables.Only one set should be input to the next Observable

Observable
.from(entrySet())
.flatMap(updateTime(errorMap, )) //flatmap1
.flatMap(updateAttribute(errorMap,)) flatmap2
.toList()
.toBlocking()
.single();

For the above pseudo code. I have a error map that collects errors in each of the functions . and then get a final map that has errors from both the flatmap functions.

also as obvious the success ones fron faltmap1 feeds as input to flatmap2.

Question: I want to get rid of the errorMap and use toMap or any other functions available in Observable.

Problem. From flatMap 1 , there are 2 outputs, a) success keys which should feed into the 2nd flatmap b) error Map that should not go as input to the 2nd flatMap…
How to return 2 sets of Observables?

Okay so there are ways to do this, since you can nest observable chain calls into the flatmap itself, but let me ask differently: what are you trying to achieve with this? Can you outline the steps you are doing in a semantical way and also what the returning result should contain?

errorMap is a java HashMap.
Map<String, String> errorMap = new HashMap<.String, String>()

Observable
.from(entrySet())
.flatMap(updateTime(errorMap, )) //flatmap1
.flatMap(updateAttribute(errorMap,)) //flatmap2

In flatMap1, we update date and time using N1ql query, From this flat Map i need to get the key and error message if the N1ql query failed to update, The keys that were updated succesful should be passed on to the next FlatMap .
In FlatMap2, for keys that were succesful from the previous step ,there is an upsert opertion. Here also upsert might fail. In that case , i need to collect the keys and the error messages.

So final output should have
a. succesful keys (that updated and upserted successfully)
b. errorMap that contains the keys that failed during the operations either in the flatMap1 or flatMap2.

I am able to get the successful keys and the errorMap.
The error Map was passed around and used for collecting the key and errorMessage that failed in either of the steps.
I want to get away using the HashMap and use any of the functionalities Observable provides to collect the errorMap. Also i do need the the successful keys List.

Even if i use nested FlatMap. i can return only 1 set of Observables that are successful that needs to be the used by the flatMap2. How do i return the list of Observables that were errors and should not be used by flatMap2?