I don't think this works as it would configure multiple outputs and filebeat does not support it.
For what I know the conditional in filebeat output does not work at the hosts level, for example check this similar forum post for the elasticsearch output.
Also check this github issue about why filebeat does not support multiple outputs.
In your case you have two different approaches.
The first one is easier, send everything to the same Logstash port and on this port create a logstash pipeline that will redirect it to other pipelines according to some conditional, this is called the distributor pattern on pipeline-to-pipeline communication as explained in the documentation.
Another option would be to use Kafka and send the data to two different topics, this can be done conditionally in filebeat since the output would be the same, just the topic would be change (there are a couple of questions about this in the forum).