The subsearch is returning a search string in the form (input=foo OR output=bar) . Perhaps that is not the right format for your main search. Let's try another method. This is the general form for one way of combining two searches. The problem is there is no common field between the two searches to use for grouping by the stats command. I'll let you find the common field and update the query.
host="main" source="main.log" INFO syslog*
| rex "(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\.)(?<id>(\d{1,3}))"
| rex "(?:disconnect )(?<input_info>\d+)"
| rex "(?:to )(?<output_info>\d+)"
| append [ search host="main" source="main.log" ERROR syslog*
| rex "(?=[\(](?<input>\d+)[,])"
| rex "(?=[, ](?<output>\d+)[\).])" ]
| stats values(*) as * by id
| table _time id
... View more