Multiple filebeat to one logstash. How to optimize the configuration

@Badger because different application logs are involved in different servers.
I mean, will it work if I write multiple grok statements for collecting from all the logs? How would I differenciate the application details if the logs don't give any?
And can I map all filebeat to reach a single port 5044?
Even if I have more than one path in each server?